本文整理汇总了C++中GetStringValue函数的典型用法代码示例。如果您正苦于以下问题:C++ GetStringValue函数的具体用法?C++ GetStringValue怎么用?C++ GetStringValue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetStringValue函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AnnotateClsidRegistrationForHive
static void
AnnotateClsidRegistrationForHive(JSONWriter& aJson, HKEY aHive,
const nsAString& aClsid,
const JSONWriter::CollectionStyle aStyle)
{
nsAutoString clsidSubkey;
clsidSubkey.AppendLiteral(kSoftwareClasses);
clsidSubkey.AppendLiteral(kClsid);
clsidSubkey.Append(aClsid);
nsAutoString className;
if (GetStringValue(aHive, clsidSubkey, kDefaultValue, className)) {
aJson.StringProperty("ClassName",
NS_ConvertUTF16toUTF8(className).get());
}
nsAutoString inprocServerSubkey(clsidSubkey);
inprocServerSubkey.AppendLiteral(kInprocServer32);
nsAutoString pathToServerDll;
if (GetStringValue(aHive, inprocServerSubkey, kDefaultValue, pathToServerDll)) {
aJson.StringProperty("Path", NS_ConvertUTF16toUTF8(pathToServerDll).get());
if (GetLoadedPath(pathToServerDll)) {
aJson.StringProperty("LoadedPath",
NS_ConvertUTF16toUTF8(pathToServerDll).get());
}
}
nsAutoString apartment;
if (GetStringValue(aHive, inprocServerSubkey, kThreadingModel, apartment)) {
aJson.StringProperty("ThreadingModel", NS_ConvertUTF16toUTF8(apartment).get());
}
}
示例2: AnnotateInterfaceRegistrationForHive
static void
AnnotateInterfaceRegistrationForHive(JSONWriter& aJson, HKEY aHive, REFIID aIid,
const JSONWriter::CollectionStyle aStyle)
{
nsAutoString interfaceSubKey;
interfaceSubKey.AppendLiteral(kSoftwareClasses);
interfaceSubKey.AppendLiteral(kInterface);
nsAutoString iid;
GUIDToString(aIid, iid);
interfaceSubKey.Append(iid);
nsAutoString interfaceName;
if (GetStringValue(aHive, interfaceSubKey, kDefaultValue, interfaceName)) {
aJson.StringProperty("InterfaceName",
NS_ConvertUTF16toUTF8(interfaceName).get());
}
nsAutoString psSubKey(interfaceSubKey);
psSubKey.AppendLiteral(kProxyStubClsid32);
nsAutoString psClsid;
if (GetStringValue(aHive, psSubKey, kDefaultValue, psClsid)) {
aJson.StartObjectProperty("ProxyStub", aStyle);
aJson.StringProperty("CLSID", NS_ConvertUTF16toUTF8(psClsid).get());
AnnotateClsidRegistrationForHive(aJson, aHive, psClsid, aStyle);
aJson.EndObject();
}
nsAutoString typelibSubKey(interfaceSubKey);
typelibSubKey.AppendLiteral(kTypeLib);
nsAutoString typelibId;
bool haveTypelibId = GetStringValue(aHive, typelibSubKey, kDefaultValue,
typelibId);
nsAutoString typelibVersion;
bool haveTypelibVersion = GetStringValue(aHive, typelibSubKey, kVersion,
typelibVersion);
if (haveTypelibId || haveTypelibVersion) {
aJson.StartObjectProperty("TypeLib", aStyle);
}
if (haveTypelibId) {
aJson.StringProperty("ID", NS_ConvertUTF16toUTF8(typelibId).get());
}
if (haveTypelibVersion) {
aJson.StringProperty("Version", NS_ConvertUTF16toUTF8(typelibVersion).get());
}
if (haveTypelibId && haveTypelibVersion) {
AnnotateTypelibRegistrationForHive(aJson, aHive, typelibId, typelibVersion,
aStyle);
}
if (haveTypelibId || haveTypelibVersion) {
aJson.EndObject();
}
}
示例3: AnnotateTypelibRegistrationForHive
static void
AnnotateTypelibRegistrationForHive(JSONWriter& aJson, HKEY aHive,
const nsAString& aTypelibId,
const nsAString& aTypelibVersion,
const JSONWriter::CollectionStyle aStyle)
{
nsAutoString typelibSubKey;
typelibSubKey.AppendLiteral(kSoftwareClasses);
typelibSubKey.AppendLiteral(kTypeLib);
typelibSubKey.AppendLiteral(kBackslash);
typelibSubKey.Append(aTypelibId);
typelibSubKey.AppendLiteral(kBackslash);
typelibSubKey.Append(aTypelibVersion);
nsAutoString typelibDesc;
if (GetStringValue(aHive, typelibSubKey, kDefaultValue, typelibDesc)) {
aJson.StringProperty("Description",
NS_ConvertUTF16toUTF8(typelibDesc).get());
}
nsAutoString flagsSubKey(typelibSubKey);
flagsSubKey.AppendLiteral(kBackslash);
flagsSubKey.AppendLiteral(kFlags);
nsAutoString typelibFlags;
if (GetStringValue(aHive, flagsSubKey, kDefaultValue, typelibFlags)) {
aJson.StringProperty("Flags", NS_ConvertUTF16toUTF8(typelibFlags).get());
}
HKEY rawTypelibKey;
LONG result = RegOpenKeyEx(aHive, typelibSubKey.get(), 0, KEY_READ,
&rawTypelibKey);
if (result != ERROR_SUCCESS) {
return;
}
nsAutoRegKey typelibKey(rawTypelibKey);
const size_t kMaxLcidCharLen = 9;
WCHAR keyName[kMaxLcidCharLen];
for (DWORD index = 0; result == ERROR_SUCCESS; ++index) {
DWORD keyNameLength = ArrayLength(keyName);
result = RegEnumKeyEx(typelibKey, index, keyName, &keyNameLength, nullptr,
nullptr, nullptr, nullptr);
unsigned long lcid;
if (result == ERROR_SUCCESS && ConvertLCID(keyName, WrapNotNull(&lcid))) {
nsDependentString strLcid(keyName, keyNameLength);
aJson.StartObjectProperty(NS_ConvertUTF16toUTF8(strLcid).get(), aStyle);
AnnotateTypelibPlatform(aJson, typelibKey, strLcid, kWin32, aStyle);
#if defined(HAVE_64BIT_BUILD)
AnnotateTypelibPlatform(aJson, typelibKey, strLcid, kWin64, aStyle);
#endif
aJson.EndObject();
}
}
}
示例4: qDebug
void QProcessResultThread::ParseSpResult( QByteArray& byJson, bool& bSuccess, QString& strUUID )
{
strUUID = "";
bSuccess = false;
QJsonParseError jsonError;
QJsonDocument jsonDoc = QJsonDocument::fromJson( byJson, &jsonError );
if ( QJsonParseError::NoError != jsonError.error ) {
qDebug( ) << jsonError.errorString( ) << endl;
return;
}
if ( jsonDoc.isNull( ) || jsonDoc.isEmpty( ) ) {
return;
}
QJsonObject jsonObj = jsonDoc.object( );
if ( jsonObj.isEmpty( ) ) {
return;
}
QJsonValue jsonVal = jsonObj.value( "Flag" );
if ( jsonVal.isDouble( ) ) {
bSuccess = jsonVal.toInt( );
}
GetStringValue( strUUID, "UUID", jsonObj );
if ( !bSuccess ) {
return;
}
QString strDateTime = "";
GetStringValue( strDateTime, "DateTime", jsonObj );
QString strPlate = "";
GetStringValue( strPlate, "Plate", jsonObj );
QString strMobile = "";
GetStringValue( strMobile, "MobilePhone", jsonObj );
QString strName = "";
GetStringValue( strName, "Name", jsonObj );
if ( strMobile.isEmpty( ) ) {
return;
}
SendShortMessage( strPlate, strDateTime, strName, strMobile );
}
示例5: switch
RDLog::LinkState RDLog::linkState(RDLog::Source src) const
{
if(linkQuantity(src)==0) {
return RDLog::LinkNotPresent;
}
switch(src) {
case RDLog::SourceMusic:
return (RDLog::LinkState)RDBool(GetStringValue("MUSIC_LINKED"));
case RDLog::SourceTraffic:
return (RDLog::LinkState)RDBool(GetStringValue("TRAFFIC_LINKED"));
}
return RDLog::LinkNotPresent;
}
示例6: GetLocalizedStringValue
NS_IMETHODIMP nsAbDirProperty::GetDirName(nsAString &aDirName)
{
if (m_DirPrefId.IsEmpty())
{
aDirName = m_ListDirName;
return NS_OK;
}
nsCString dirName;
nsresult rv = GetLocalizedStringValue("description", EmptyCString(), dirName);
NS_ENSURE_SUCCESS(rv, rv);
// In TB 2 only some prefs had chrome:// URIs. We had code in place that would
// only get the localized string pref for the particular address books that
// were built-in.
// Additionally, nsIPrefBranch::getComplexValue will only get a non-user-set,
// non-locked pref value if it is a chrome:// URI and will get the string
// value at that chrome URI. This breaks extensions/autoconfig that want to
// set default pref values and allow users to change directory names.
//
// Now we have to support this, and so if for whatever reason we fail to get
// the localized version, then we try and get the non-localized version
// instead. If the string value is empty, then we'll just get the empty value
// back here.
if (dirName.IsEmpty())
{
rv = GetStringValue("description", EmptyCString(), dirName);
NS_ENSURE_SUCCESS(rv, rv);
}
CopyUTF8toUTF16(dirName, aDirName);
return NS_OK;
}
示例7: GetBoolValue
// Load/Save
BOOL COptionsMisc::Load()
{
m_bParentFolder = GetBoolValue ("ParentFolder", TRUE) ? true : false;
// Load Icons Info
m_bShowIcons = GetBoolValue ("ShowIcons", TRUE) ? true : false;
// Load Thumbnails Info
m_bShowThumbnails = GetBoolValue ("ShowThumbnails", TRUE) ? true : false;
SetAutoExtractIcons(GetBoolValue("AutoExtractIcons", TRUE) ? true : false);
SetAutoExtractClassHelp(GetBoolValue("AutoExtractClassHelp", TRUE) ? true : false);
m_bShowUndoWarnings = GetBoolValue ("ShowUndoWarnings", TRUE) ? true : false;
m_bShowFullPath = GetBoolValue("ShowFullPathInTitle", FALSE) ? true : false;
m_bAutoLoadProj = GetBoolValue("AutoLoadProj", TRUE) ? true : false;
m_bDefaultCompressed = GetBoolValue("DefaultCompressed", TRUE) ? true : false;
m_bLoadLYTFile = GetBoolValue("LoadLYTFile", TRUE) ? true : false;
m_bUndoFreezeHide = GetBoolValue("UndoFreezeHide", FALSE) ? true : false;
// Load undo data
m_dwUndos = GetDWordValue("NumUndos", 40);
SetVectorEditIncrement(atof(GetStringValue("VectorEditIncrement", "0.1")));
SetVectorEditAutoApply(GetBoolValue("VectorEditAutoApply", TRUE) ? true : false);
SetRotationEditAutoApply(GetBoolValue("RotationEditAutoApply", TRUE) ? true : false);
return TRUE;
}
示例8: _T
/**
* Funcao para adicionar o aspas no caso de data e strings
*/
CString CField::GetQueryFormatValue()
{
CString s;
if(m_type == FIELD_TYPE_STRING ||
m_type == FIELD_TYPE_DATE ||
m_type == FIELD_TYPE_BOOLCHAR )
{
s.Format(_T("'%s'"), m_sValue);
return s;
}
m_sValue.TrimLeft();
m_sValue.TrimRight();
if(m_sValue.IsEmpty() &&
( m_type == FIELD_TYPE_NUMBER ||
m_type == FIELD_TYPE_CURRENCY)
)
{
return _T("");
}
return GetStringValue();
}
示例9: switch
bool Var::Equals(Var* rvalue) {
switch(type) {
case vtInt: {
return GetIntValue() == rvalue->GetIntValue();
}
case vtFloat: {
return GetFloatValue() == rvalue->GetFloatValue();
}
case vtString: {
char* lvaluetext = GetStringValue();
char* rvaluetext = rvalue->GetStringValue();
bool result = !strcmp(lvaluetext,rvaluetext);
delete[] lvaluetext;
delete[] rvaluetext;
return result;
}
case vtFloat3: {
return float3value == rvalue->float3value;
}
case vtObject: {
return objectvalue == rvalue->objectvalue; // compare pointers...
}
default: {
return false;
}
}
}
示例10: GetStringValue
CString CTableBase::GetStringValueNoNULL(LPCTSTR _szLabel)
{
CString s = GetStringValue(_szLabel);
if(s.CompareNoCase(_T("NULL")) == 0)
return _T("");
return s;
}
示例11: NS_PRECONDITION
PRBool
nsAttrValue::GetColorValue(nscolor& aColor) const
{
NS_PRECONDITION(Type() == eColor || Type() == eString, "wrong type");
switch (BaseType()) {
case eString:
{
return GetPtr() && NS_ColorNameToRGB(GetStringValue(), &aColor);
}
case eOtherBase:
{
aColor = GetMiscContainer()->mColor;
break;
}
case eIntegerBase:
{
aColor = static_cast<nscolor>(GetIntInternal());
break;
}
default:
{
NS_NOTREACHED("unexpected basetype");
break;
}
}
return PR_TRUE;
}
示例12: GetValue
/**
@brief Get a parsed value from the config file
@param cName The name of the variable in the config file
@param n The position of the value in a multivalue field.
For "MyArray 10 56 38 52 46;", GetValue<int>("MyArray", 3) will return 52. (the first value is at n=0)
**/
T GetValue(const char* cName, int n=0)const
{
std::string sValue(GetStringValue(cName)+" ");
std::string sCurrValue;
int nPos=0;
for(unsigned int i=0 ; i<sValue.size() ; i++)
{
if(sValue[i]!=' ' && sValue[i]!='\t')
{
sCurrValue+=sValue[i];
}
else
{
if(nPos==n)
{
std::stringstream ss(sCurrValue);
T a;
ss>>a;
return a;
}
else
{
sCurrValue="";
nPos++;
}
}
示例13: NS_ENSURE_ARG_POINTER
NS_IMETHODIMP nsAbMDBDirectory::GetDatabaseFile(nsILocalFile **aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
nsCString fileName;
nsresult rv = GetStringValue("filename", EmptyCString(), fileName);
NS_ENSURE_SUCCESS(rv, rv);
if (fileName.IsEmpty())
return NS_ERROR_NOT_INITIALIZED;
nsCOMPtr<nsIFile> profileDir;
rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,
getter_AddRefs(profileDir));
NS_ENSURE_SUCCESS(rv, rv);
rv = profileDir->AppendNative(fileName);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsILocalFile> dbFile = do_QueryInterface(profileDir, &rv);
NS_ENSURE_SUCCESS(rv, rv);
NS_ADDREF(*aResult = dbFile);
return NS_OK;
}
示例14: GetStringValue
int wxTextWidgetImpl::GetLineLength(long lineNo) const
{
// TODO: change this if possible to reflect real lines
wxString content = GetStringValue() ;
// Find line first
int count = 0;
for (size_t i = 0; i < content.length() ; i++)
{
if (count == lineNo)
{
// Count chars in line then
count = 0;
for (size_t j = i; j < content.length(); j++)
{
if (content[j] == '\n')
return count;
count++;
}
return count;
}
if (content[i] == '\n')
count++;
}
return 0 ;
}
示例15: SelectItem
void wxTreeViewComboPopup::OnSelectionChanged(wxGxSelectionEvent& event)
{
if(event.GetInitiator() == GetId())
return;
long nSelID = m_pSelection->GetLastSelectedObjectId();
wxTreeItemId ItemId = m_TreeMap[nSelID];
if(ItemId.IsOk())
{
SelectItem(ItemId);
}
else
{
wxGxObject* pGxObject = m_pCatalog->GetRegisterObject(nSelID);
wxGxObject* pParentGxObj = pGxObject->GetParent();
while(pParentGxObj)
{
wxTreeItemId ItemId = m_TreeMap[pParentGxObj->GetId()];
if(ItemId.IsOk())
{
Expand(ItemId);
break;
}
else
pParentGxObj = pParentGxObj->GetParent();
}
OnSelectionChanged(event);
}
//set combo text
wxString sText = GetStringValue();
m_combo->SetText(sText);
}