WebGrep::IssuedRequest Client::issueRequest(const char* method, const char* path, bool withLock) { (void)method; std::shared_ptr<std::lock_guard<std::mutex>> lk; if (withLock) { lk = std::make_shared<std::lock_guard<std::mutex>>(ctx->mu); } ctx->response.clear(); IssuedRequest out; QString url = scheme(); url += "://"; url += ctx->host_and_port.data(); url += path; out.req.setUrl(url); out.req.setRawHeader("User-Agent", "Qt5GET 1.0"); out.ctx = ctx; return out; }
// ----------------------------------------------------------------------------- // CAvkonStartupExtensionPlugIn::SetColorPalette // // ----------------------------------------------------------------------------- // TInt CAvkonStartupExtensionPlugIn::SetColorPalette() { CRepository* repository = NULL; TRAPD( errorCode, repository = CRepository::NewL( KCRUidPersonalisation ) ); if ( errorCode == KErrNone ) { TInt scheme( 0 ); errorCode = repository->Get( KPslnColorPalette, scheme ); if ( errorCode == KErrNone ) { DynamicPalette::SetColor256Util((DynamicPalette::TIndex)scheme); } } delete repository; return errorCode; }
void acceptPasteData(const QMimeData *source, PasteAcceptor *acceptor) { if (source->hasFormat(QStringLiteral("text/plain"))) { acceptor->acceptPlainText(source->text()); return; } if (!source->urls().isEmpty()) { auto url = source->urls().first(); if (url.isEmpty() || url.scheme() != "file") return; acceptor->acceptFileUrl(url); return; } if (source->hasFormat(QStringLiteral("application/x-qt-image"))) acceptor->acceptImageData(source->data(QStringLiteral("application/x-qt-image"))); }
void CUrl::ConstructL(const TDesC& aUrl) // // Non-trivial c'tor - can be used for all general urls { // Stripe any leading whitespace TPtrC url = aUrl; while( url.Locate(' ') == 0 ) { // Remove the leading whitespace -> set pointer to second character url.Set(url.Mid(1)); } iUrlDes = url.AllocL(); // Check to see if there's ':' at start of aUrl TInt colonPos = aUrl.Locate(':'); if (colonPos == 0) User::Leave(EWapErrCorruptUrl); TPtrC scheme(Component(EUrlScheme)); CheckSchemeValidL(scheme); }
/* absoluteURI = scheme ":" ( hier_part | opaque_part ) scheme = alpha *( alpha | digit | "+" | "-" | "." ) hier_part = ( net_path | abs_path ) [ "?" query ] abs_path = "/" path_segments query = *uric opaque_part = uric_no_slash *uric */ std::string abs_uri() { std::string s; s = scheme() + ":"; if(rand(2)) { if(rand(2)) s += net_path(); else s += abs_path(); if(rand(2)) s += "?" + query(); } else { s += opaque_part(); } return s; }
virtual void ApplySchemeSettings(IScheme *pScheme) { // set up the scheme settings Button::ApplySchemeSettings(pScheme); _textColor = GetSchemeColor("PropertySheet.SelectedTextColor", GetFgColor(), pScheme); _dimTextColor = GetSchemeColor("PropertySheet.TextColor", GetFgColor(), pScheme); m_pActiveBorder = pScheme->GetBorder("TabActiveBorder"); m_pNormalBorder = pScheme->GetBorder("TabBorder"); if ( m_pImage ) { ClearImages(); m_pImage->SetImage(scheme()->GetImage(m_pszImageName, false)); AddImage( m_pImage->GetImage(), 2 ); int w, h; m_pImage->GetSize( w, h ); w += m_pContextLabel ? 10 : 0; if ( m_pContextLabel ) { m_pImage->SetPos( 10, 0 ); } SetSize( w + 4, h + 2 ); } else { int wide, tall; int contentWide, contentTall; GetSize(wide, tall); GetContentSize(contentWide, contentTall); wide = max(m_bMaxTabWidth, contentWide + 10); // 10 = 5 pixels margin on each side wide += m_pContextLabel ? 10 : 0; SetSize(wide, tall); } if ( m_pContextLabel ) { SetTextInset( 12, 0 ); } }
void CDialog_PPEPrecache::FillList() { ScrollBar *pScroll = m_pList_Effects->GetScrollbar(); int scrollValue = pScroll ? pScroll->GetValue() : 0; m_pList_Effects->DeleteAllItems(); GetPPCache()->ClearInvalidEntries(); HFont fontMarlett = scheme()->GetIScheme( GetScheme() )->GetFont( "Marlett", false ); for ( int i = 0; i < GetPPCache()->GetNumPostProcessingEffects(); i++ ) { EditorPostProcessingEffect *effect = GetPPCache()->GetPostProcessingEffect( i ); Label *pL = new Label( m_pList_Effects, "", effect->pszName ); Button *pDel = new Button( m_pList_Effects, "", "Delete", this, VarArgs("del_effect_%i",i) ); CheckButton *pCheck = new CheckButton( m_pList_Effects, effect->pszName, "" ); pCheck->AddActionSignalTarget( this ); pCheck->SetSelected( effect->bStartEnabled ); Button *pDown = new Button( m_pList_Effects, "", "u", this, VarArgs("movedown_effect_%i",i) ); Button *pUp = new Button( m_pList_Effects, "", "t", this, VarArgs("moveup_effect_%i",i) ); pDown->SetFont( fontMarlett ); pUp->SetFont( fontMarlett ); pDel->SetContentAlignment( Label::a_center ); pDown->SetContentAlignment( Label::a_center ); pUp->SetContentAlignment( Label::a_center ); m_pList_Effects->AddItem( NULL, pCheck ); m_pList_Effects->AddItem( NULL, pDown ); m_pList_Effects->AddItem( NULL, pUp ); m_pList_Effects->AddItem( pL, pDel ); } if ( pScroll ) pScroll->SetValue( scrollValue ); }
PRBool nsHTMLContentSerializer::IsJavaScript(nsIAtom* aAttrNameAtom, const nsAString& aValueString) { if (aAttrNameAtom == nsGkAtoms::href || aAttrNameAtom == nsGkAtoms::src) { static const char kJavaScript[] = "javascript"; PRInt32 pos = aValueString.FindChar(':'); if (pos < (PRInt32)(sizeof kJavaScript - 1)) return PR_FALSE; nsAutoString scheme(Substring(aValueString, 0, pos)); scheme.StripWhitespace(); if ((scheme.Length() == (sizeof kJavaScript - 1)) && scheme.EqualsIgnoreCase(kJavaScript)) return PR_TRUE; else return PR_FALSE; } return nsContentUtils::IsEventAttributeName(aAttrNameAtom, EventNameType_HTML); }
void Leapforg::solver() { std::vector<double> uNew(M_+1), uMid(M_+1), uOld(M_+1); init(uNew, uMid); prePrint(); double currentT = 0; bool stop = false; for (int n = 1; stop != true; ++n) { uOld = uNew; currentT = n * stepT_; scheme(n, uOld, uMid, uNew); if(isNeedPrint(currentT)) { print(currentT, uNew); } stop = isNeedStop(currentT); } postPrint(); }
ResourceRequest* ResourceManager::createResourceRequest(QObject* parent, const QUrl& url) { auto normalizedURL = normalizeURL(url); auto scheme = normalizedURL.scheme(); ResourceRequest* request = nullptr; if (scheme == URL_SCHEME_FILE) { request = new FileResourceRequest(normalizedURL); } else if (scheme == URL_SCHEME_HTTP || scheme == URL_SCHEME_HTTPS || scheme == URL_SCHEME_FTP) { request = new HTTPResourceRequest(normalizedURL); } else if (scheme == URL_SCHEME_ATP) { request = new AssetResourceRequest(normalizedURL); } else { qDebug() << "Unknown scheme (" << scheme << ") for URL: " << url.url(); return nullptr; } Q_ASSERT(request); request->moveToThread(&_thread); return request; }
nsresult nsOSHelperAppService::OSProtocolHandlerExists(const char * aProtocolScheme, bool * aHandlerExists) { // look up the protocol scheme in the windows registry....if we find a match then we have a handler for it... *aHandlerExists = PR_FALSE; if (aProtocolScheme && *aProtocolScheme) { #if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN // Vista: use new application association interface if (mAppAssoc) { PRUnichar * pResult = nsnull; NS_ConvertASCIItoUTF16 scheme(aProtocolScheme); // We are responsible for freeing returned strings. HRESULT hr = mAppAssoc->QueryCurrentDefault(scheme.get(), AT_URLPROTOCOL, AL_EFFECTIVE, &pResult); if (SUCCEEDED(hr)) { CoTaskMemFree(pResult); *aHandlerExists = PR_TRUE; } return NS_OK; } #endif HKEY hKey; LONG err = ::RegOpenKeyExW(HKEY_CLASSES_ROOT, NS_ConvertASCIItoUTF16(aProtocolScheme).get(), 0, KEY_QUERY_VALUE, &hKey); if (err == ERROR_SUCCESS) { err = ::RegQueryValueExW(hKey, L"URL Protocol", NULL, NULL, NULL, NULL); *aHandlerExists = (err == ERROR_SUCCESS); // close the key ::RegCloseKey(hKey); } } return NS_OK; }
/** * adds file profile to Grid Service Object */ void cpr_checkpoint_cpi_impl::sync_add_file (int &ret, saga::url url) { std::string guid; {//scoped lock adaptor_data_t d(this); guid = d->migol_guid; if ( guid == "") { SAGA_ADAPTOR_THROW (std::string ("Migol infrastructure could not be initialized."), saga::IncorrectState); } std::cout << "cpr_checkpoint_cpi_impl::add_file: " << guid << std::endl; } // translate 'any' and 'cpr' url schemes to lfn, decline all others std::string scheme (url.get_scheme ()); if ( ! scheme.empty () && scheme != "gsiftp") { SAGA_OSSTREAM strm; strm << "cpr::migol_cpr_checkpoint_cpi_impl::add_file: " "cannot handle checkpoint name: " << url; SAGA_ADAPTOR_THROW(SAGA_OSSTREAM_GETSTRING(strm), saga::BadParameter); } bool result = false; { result = migol::instance()->register_checkpoint(guid, url.get_url()); } if (!result) { SAGA_OSSTREAM strm; strm << "cpr::migol_cpr_checkpoint_cpi_impl::add_file: " "cannot handle checkpoint name: " << url.get_url(); SAGA_ADAPTOR_THROW(SAGA_OSSTREAM_GETSTRING(strm), saga::BadParameter); } }
PRBool nsHTMLContentSerializer::IsJavaScript(nsIAtom* aAttrNameAtom, const nsAString& aValueString) { if (aAttrNameAtom == nsHTMLAtoms::href || aAttrNameAtom == nsHTMLAtoms::src) { static const char kJavaScript[] = "javascript"; PRInt32 pos = aValueString.FindChar(':'); if (pos < (PRInt32)(sizeof kJavaScript - 1)) return PR_FALSE; nsAutoString scheme(Substring(aValueString, 0, pos)); scheme.StripWhitespace(); if ((scheme.Length() == (sizeof kJavaScript - 1)) && scheme.EqualsIgnoreCase(kJavaScript)) return PR_TRUE; else return PR_FALSE; } PRBool result = (aAttrNameAtom == nsLayoutAtoms::onblur) || (aAttrNameAtom == nsLayoutAtoms::onchange) || (aAttrNameAtom == nsLayoutAtoms::onclick) || (aAttrNameAtom == nsLayoutAtoms::ondblclick) || (aAttrNameAtom == nsLayoutAtoms::onfocus) || (aAttrNameAtom == nsLayoutAtoms::onkeydown) || (aAttrNameAtom == nsLayoutAtoms::onkeypress) || (aAttrNameAtom == nsLayoutAtoms::onkeyup) || (aAttrNameAtom == nsLayoutAtoms::onload) || (aAttrNameAtom == nsLayoutAtoms::onmousedown) || (aAttrNameAtom == nsLayoutAtoms::onpageshow) || (aAttrNameAtom == nsLayoutAtoms::onpagehide) || (aAttrNameAtom == nsLayoutAtoms::onmousemove) || (aAttrNameAtom == nsLayoutAtoms::onmouseout) || (aAttrNameAtom == nsLayoutAtoms::onmouseover) || (aAttrNameAtom == nsLayoutAtoms::onmouseup) || (aAttrNameAtom == nsLayoutAtoms::onreset) || (aAttrNameAtom == nsLayoutAtoms::onselect) || (aAttrNameAtom == nsLayoutAtoms::onsubmit) || (aAttrNameAtom == nsLayoutAtoms::onunload) || (aAttrNameAtom == nsLayoutAtoms::onabort) || (aAttrNameAtom == nsLayoutAtoms::onerror) || (aAttrNameAtom == nsLayoutAtoms::onpaint) || (aAttrNameAtom == nsLayoutAtoms::onresize) || (aAttrNameAtom == nsLayoutAtoms::onscroll) || (aAttrNameAtom == nsLayoutAtoms::onbroadcast) || (aAttrNameAtom == nsLayoutAtoms::onclose) || (aAttrNameAtom == nsLayoutAtoms::oncontextmenu) || (aAttrNameAtom == nsLayoutAtoms::oncommand) || (aAttrNameAtom == nsLayoutAtoms::oncommandupdate) || (aAttrNameAtom == nsLayoutAtoms::ondragdrop) || (aAttrNameAtom == nsLayoutAtoms::ondragenter) || (aAttrNameAtom == nsLayoutAtoms::ondragexit) || (aAttrNameAtom == nsLayoutAtoms::ondraggesture) || (aAttrNameAtom == nsLayoutAtoms::ondragover) || (aAttrNameAtom == nsLayoutAtoms::oninput); return result; }
/*! This is a convenience version of select operating on QUrl objects. If the scheme is not file or qrc, \a filePath is returned immediately. Otherwise selection is applied to the path of \a filePath and a QUrl is returned with the selected path and other QUrl parts the same as \a filePath. See the class overview for the selection algorithm. */ QUrl QFileSelector::select(const QUrl &filePath) const { Q_D(const QFileSelector); if (!isLocalScheme(filePath.scheme()) && !filePath.isLocalFile()) return filePath; QUrl ret(filePath); if (isLocalScheme(filePath.scheme())) { QLatin1String scheme(":"); #ifdef Q_OS_ANDROID // use other scheme because ":" means "qrc" here if (filePath.scheme() == QLatin1String("assets")) scheme = QLatin1String("assets:"); #endif QString equivalentPath = scheme + filePath.path(); QString selectedPath = d->select(equivalentPath); ret.setPath(selectedPath.remove(0, scheme.size())); } else { ret = QUrl::fromLocalFile(d->select(ret.toLocalFile())); } return ret; }
PRBool nsGnomeVFSProtocolHandler::IsSupportedProtocol(const nsCString &aSpec) { const char *specString = aSpec.get(); const char *colon = strchr(specString, ':'); if (!colon) return PR_FALSE; PRUint32 length = colon - specString + 1; // <scheme> + ':' nsCString scheme(specString, length); char *found = PL_strcasestr(mSupportedProtocols.get(), scheme.get()); if (!found) return PR_FALSE; if (found[length] != ',' && found[length] != '\0') return PR_FALSE; return PR_TRUE; }
KeyframeHelper::KeyframeHelper(QWidget *parent) : QWidget(parent) , frameLength(1) , m_geom(NULL) , m_position(0) , m_scale(0) , m_movingKeyframe(false) , m_movingItem() , m_hoverKeyframe(-1) , m_seekPosition(SEEK_INACTIVE) { setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont)); setMouseTracking(true); QPalette p = palette(); m_size = QFontInfo(font()).pixelSize() * 1.8; m_lineHeight = m_size / 2; setMinimumHeight(m_size); setMaximumHeight(m_size); KColorScheme scheme(p.currentColorGroup(), KColorScheme::Window, KSharedConfig::openConfig(KdenliveSettings::colortheme())); m_selected = scheme.decoration(KColorScheme::HoverColor).color(); m_keyframe = scheme.foreground(KColorScheme::LinkText).color(); }
void Theme::writeColorSchemeSettings() { if (m_colorIndex < 0 || m_colorIndex > m_colorSchemeFiles.size()) return; gConfig.beginGroup("Appearance"); gConfig.setValue("Scheme", m_colorSchemeFiles[m_colorIndex]); // copy colour settings from .scheme file to gConfig QString schemeFile = Theme::availableColorSchemes.value(m_colorSchemeFiles[m_colorIndex]); QSettings scheme(schemeFile, QSettings::IniFormat); if (scheme.status() == QSettings::NoError){ scheme.beginGroup("Colors"); QHashIterator<QString, QString> i(gDefaultColorValues); while (i.hasNext()) { i.next(); gConfig.setValue(i.key(), scheme.value(i.key(), i.value()).toString()); } } gConfig.endGroup(); gConfig.sync(); }
bool nsGIOProtocolHandler::IsSupportedProtocol(const nsCString &aSpec) { const char *specString = aSpec.get(); const char *colon = strchr(specString, ':'); if (!colon) return false; uint32_t length = colon - specString + 1; // <scheme> + ':' nsCString scheme(specString, length); char *found = PL_strcasestr(mSupportedProtocols.get(), scheme.get()); if (!found) return false; if (found[length] != ',' && found[length] != '\0') return false; return true; }
/** * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] * * foo://[email protected]:8042/over/there?name=ferret#nose * \_/ \_______________________/\_________/ \_________/ \__/ * | | | | | * scheme authority path query fragment */ inline std::tstring_t Uri::uri() const { std::tstring_t sRv; std::tstring_t temp; temp = scheme(); if (!temp.empty()) { sRv += xT(""); sRv += temp; } temp = authority(); if (!temp.empty()) { sRv += xT(":"); sRv += temp; } temp = path(); if (!temp.empty()) { sRv += xT(""); sRv += temp; } temp = query(); if (!temp.empty()) { sRv += xT("?"); sRv += temp; } temp = fragment(); if (!temp.empty()) { sRv += xT("#"); sRv += temp; } return sRv; }
//----------------------------------------------------------------------------- Color CHudChat::GetClientColor( int clientIndex ) { IScheme *pScheme = scheme()->GetIScheme( GetScheme() ); if ( pScheme == NULL ) return Color( 255, 255, 255, 255 ); if ( clientIndex == 0 ) // console msg { return g_ColorGreen; } else if( g_PR ) { int iTeam = g_PR->GetTeam( clientIndex ); C_TFPlayer *pPlayer = ToTFPlayer( UTIL_PlayerByIndex( clientIndex ) ); C_TFPlayer *pLocalPlayer = C_TFPlayer::GetLocalTFPlayer(); if ( IsVoiceSubtitle() == true ) { // if this player is on the other team, disguised as my team, show disguised color if ( pPlayer && pLocalPlayer && pPlayer->m_Shared.InCond( TF_COND_DISGUISED ) && pPlayer->m_Shared.GetDisguiseTeam() == pLocalPlayer->GetTeamNumber() ) { iTeam = pPlayer->m_Shared.GetDisguiseTeam(); } } switch ( iTeam ) { case TF_TEAM_RED : return pScheme->GetColor( "TFColors.ChatTextRed", g_ColorRed ); case TF_TEAM_BLUE : return pScheme->GetColor( "TFColors.ChatTextBlue", g_ColorBlue );; default : return g_ColorGrey; } } return g_ColorYellow; }
hl::Url hl::Url::FromRedirect(const std::string & redirect) const { // If protocol string exists, then we can return a new Url ci it = std::search( redirect.begin(), redirect.end(), prot_end.begin(), prot_end.end() ); if ( it != redirect.end() ) { return Url(redirect); } else { // Returned url should always start with scheme std::string url = scheme(); // Check for host if ( redirect.compare(0, host_begin.size(), host_begin) == 0 ) { // Protocol is missing but URL has a host- just append to scheme url += prot_sep + redirect; } else { // URL has no host- append redirect to existing host url += prot_end; if ( ! user_.empty() || ! pass_.empty() ) url += user_ + pass_sep + pass_ + login_sep; url += host_; if ( ! port_.empty() ) url += port_sep + port_; url += redirect; } return Url(url); } }
void Url::setUrlType(const char* urlProtocol) { if (urlProtocol) { UtlString schemeName(urlProtocol); mScheme = scheme(schemeName); if ( UnknownUrlScheme == mScheme ) { OsSysLog::add(FAC_SIP, PRI_ERR, "Url::setUrlType unsupported Url scheme '%s'", urlProtocol ); } } else { // no urlProtocol value passed OsSysLog::add(FAC_SIP, PRI_CRIT, "Url::setUrlType Url scheme NULL"); assert(urlProtocol); mScheme = UnknownUrlScheme; } }
void Theme::setCurrentColorIndex(int index) { ensureLoaded(); QString schemePath = Theme::availableColorSchemes.value(m_colorSchemeFiles.value(index)); if (schemePath.isEmpty()) return; QSettings scheme(schemePath, QSettings::IniFormat); scheme.beginGroup("Colors"); m_palette.setColor(QPalette::Normal, QPalette::Window, scheme.value("Background").toString()); m_palette.setColor(QPalette::Normal, QPalette::Button, scheme.value("Button").toString()); m_palette.setColor(QPalette::Normal, QPalette::Highlight, scheme.value("Highlight").toString()); m_palette.setColor(QPalette::Normal, QPalette::Text, scheme.value("Text").toString()); m_palette.setColor(QPalette::Normal, QPalette::Base, scheme.value("Base").toString()); if (m_titlePreview) m_titlePreview->setPalette(m_palette); if (m_softMenuBarPreview) m_softMenuBarPreview->setPalette(m_palette); m_colorIndex = index; }
std::istream* URIStreamOpener::open(const std::string& basePathOrURI, const std::string& pathOrURI) const { FastMutex::ScopedLock lock(_mutex); try { URI uri(basePathOrURI); std::string scheme(uri.getScheme()); FactoryMap::const_iterator it = _map.find(scheme); if (it != _map.end()) { uri.resolve(pathOrURI); return openURI(scheme, uri); } } catch (Exception&) { } Path base(basePathOrURI, Path::PATH_GUESS); Path path(pathOrURI, Path::PATH_GUESS); base.resolve(path); return openFile(base); }
void datalogProgram :: datalogProg(){ if (tokens.at(vecIndex).getTokenType() == SCHEMES){ match(SCHEMES); match(COLON); scheme(); schemeList(); match(FACTS); match(COLON); factList(); match(RULES); match(COLON); ruleList(); match(QUERIES); match(COLON); query(); queryList(); } else{ if (currentStatus == true){ currentStatus = false; falseTok = tokens.at(vecIndex); } } }
AnimKeyframeRuler::AnimKeyframeRuler(int min, int max, QWidget *parent) : QWidget(parent) , frameLength(max - min) , m_position(0) , m_scale(0) , m_movingKeyframe(false) , m_movingKeyframePos(-1) , m_movingKeyframeType(mlt_keyframe_linear) , m_hoverKeyframe(-1) , m_selectedKeyframe(-1) , m_seekPosition(SEEK_INACTIVE) , m_attachedToEnd(-2) { setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont)); setMouseTracking(true); QPalette p = palette(); m_size = QFontInfo(font()).pixelSize() * 1.8; m_lineHeight = m_size / 2; setMinimumHeight(m_size); setMaximumHeight(m_size); KColorScheme scheme(p.currentColorGroup(), KColorScheme::Window, KSharedConfig::openConfig(KdenliveSettings::colortheme())); m_selected = palette().highlight().color(); m_keyframe = scheme.foreground(KColorScheme::LinkText).color(); }
nsresult NumberingScheme::Init (nsIRDFDataSource* aDS, nsIRDFResource* aResource) { mComponents.Clear(); NS_ENSURE_ARG(aDS); NS_ENSURE_ARG(aResource); mResource = aResource; nsresult rv; nsCOMPtr<nsIRDFService> rdfsvc( do_GetService("@mozilla.org/rdf/rdf-service;1")); nsCOMPtr<nsIRDFDataSource> schemads; rdfsvc->GetDataSourceBlocking("chrome://celtx/content/schema.rdf", getter_AddRefs(schemads)); nsCOMPtr<nsIRDFCompositeDataSource> compds = do_CreateInstance( "@mozilla.org/rdf/datasource;1?name=composite-datasource"); compds->AddDataSource(schemads); compds->AddDataSource(aDS); nsCOMPtr<nsIRDFResource> posarc, numarc, prearc, sufarc; rdfsvc->GetResource(NS_LITERAL_CSTRING("http://celtx.com/NS/v1/position"), getter_AddRefs(posarc)); rdfsvc->GetResource(NS_LITERAL_CSTRING("http://celtx.com/NS/v1/numbering"), getter_AddRefs(numarc)); rdfsvc->GetResource(NS_LITERAL_CSTRING("http://celtx.com/NS/v1/prefix"), getter_AddRefs(prearc)); rdfsvc->GetResource(NS_LITERAL_CSTRING("http://celtx.com/NS/v1/suffix"), getter_AddRefs(sufarc)); nsCOMPtr<nsIRDFContainer> cont = do_CreateInstance( "@mozilla.org/rdf/container;1"); rv = cont->Init(compds, aResource); NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr<nsISimpleEnumerator> elements; rv = cont->GetElements(getter_AddRefs(elements)); NS_ENSURE_SUCCESS(rv, rv); if (! elements) return NS_ERROR_INVALID_ARG; PRUint32 processed = 0; PRBool hasMore; rv = elements->HasMoreElements(&hasMore); while (NS_SUCCEEDED(rv) && hasMore) { nsCOMPtr<nsISupports> elem; rv = elements->GetNext(getter_AddRefs(elem)); if (NS_FAILED(rv) || ! elem) break; nsCOMPtr<nsIRDFResource> scheme(do_QueryInterface(elem)); if (! scheme) break; nsCOMPtr<nsIRDFNode> posnode, numnode, prenode, sufnode; compds->GetTarget(scheme, posarc, PR_TRUE, getter_AddRefs(posnode)); compds->GetTarget(scheme, numarc, PR_TRUE, getter_AddRefs(numnode)); compds->GetTarget(scheme, prearc, PR_TRUE, getter_AddRefs(prenode)); compds->GetTarget(scheme, sufarc, PR_TRUE, getter_AddRefs(sufnode)); nsCOMPtr<nsIRDFLiteral> numlit(do_QueryInterface(numnode)), poslit(do_QueryInterface(posnode)), prelit(do_QueryInterface(prenode)), suflit(do_QueryInterface(sufnode)); NumberingComponent component; nsXPIDLString position, numbering, prefix, suffix; if (numlit) numlit->GetValue(getter_Copies(numbering)); if (numbering.IsEmpty()) break; if (poslit) poslit->GetValue(getter_Copies(position)); if (! position.IsEmpty()) { if (position.Equals(NS_LITERAL_STRING("before"))) component.position = NumberingComponent::BEFORE; else if (position.Equals(NS_LITERAL_STRING("after"))) component.position = NumberingComponent::AFTER; else break; } else if (processed > 0) break; if (numbering.Equals(NS_LITERAL_STRING("number"))) component.numbering = NumberingComponent::NUMBER; else if (numbering.Equals(NS_LITERAL_STRING("letter"))) component.numbering = NumberingComponent::LETTER; else break; if (prelit) prelit->GetValue(getter_Copies(prefix)); if (! prefix.IsEmpty()) component.prefix.Assign(prefix); if (suflit) suflit->GetValue(getter_Copies(suffix)); if (! suffix.IsEmpty()) component.suffix.Assign(suffix); mComponents.AppendElement(component); ++processed; rv = elements->HasMoreElements(&hasMore); } return mComponents.Length() ? NS_OK : NS_ERROR_FAILURE; }
void url:: user_info(const stream9::opt<boost::string_ref> &user_info) { rebuild(scheme(), host(), port(), path(), query(), fragment(), user_info); }
void url:: port(const stream9::opt<uint16_t> port) { rebuild(scheme(), host(), port, path(), query(), fragment(), user_info()); }
void GDBOutputWidget::updateColors() { KColorScheme scheme(QPalette::Active); gdbColor_ = scheme.foreground(KColorScheme::LinkText).color(); errorColor_ = scheme.foreground(KColorScheme::NegativeText).color(); }