本文整理汇总了C++中GetStringValue函数的典型用法代码示例。如果您正苦于以下问题:C++ GetStringValue函数的具体用法?C++ GetStringValue怎么用?C++ GetStringValue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetStringValue函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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());
}
}
开发者ID:yrliou,项目名称:gecko-dev,代码行数:33,代码来源:InterfaceRegistrationAnnotator.cpp
示例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();
}
}
开发者ID:yrliou,项目名称:gecko-dev,代码行数:60,代码来源:InterfaceRegistrationAnnotator.cpp
示例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();
}
}
}
开发者ID:yrliou,项目名称:gecko-dev,代码行数:57,代码来源:InterfaceRegistrationAnnotator.cpp
示例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 );
}
开发者ID:Anne081031,项目名称:ParkSolution,代码行数:50,代码来源:qprocessresultthread.cpp
示例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;
}
开发者ID:radio-helsinki-graz,项目名称:rivendell,代码行数:14,代码来源:rdlog.cpp
示例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;
}
开发者ID:MoonchildProductions,项目名称:FossaMail,代码行数:33,代码来源:nsAbDirProperty.cpp
示例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;
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:33,代码来源:OptionsMisc.cpp
示例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();
}
开发者ID:MFDonadeli,项目名称:PMA,代码行数:28,代码来源:TableBase.cpp
示例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;
}
}
}
开发者ID:JohanMes,项目名称:JohanEngine,代码行数:27,代码来源:Variable.cpp
示例10: GetStringValue
CString CTableBase::GetStringValueNoNULL(LPCTSTR _szLabel)
{
CString s = GetStringValue(_szLabel);
if(s.CompareNoCase(_T("NULL")) == 0)
return _T("");
return s;
}
开发者ID:MFDonadeli,项目名称:PMA,代码行数:7,代码来源:TableBase.cpp
示例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;
}
开发者ID:EdgarChen,项目名称:mozilla-cvs-history,代码行数:31,代码来源:nsAttrValue.cpp
示例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++;
}
}
开发者ID:CromFr,项目名称:Aerodrone_gui,代码行数:33,代码来源:ConfigFile.hpp
示例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;
}
开发者ID:binoc-software,项目名称:mozilla-cvs,代码行数:26,代码来源:nsAbMDBDirectory.cpp
示例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 ;
}
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:30,代码来源:textctrl_osx.cpp
示例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);
}
开发者ID:GimpoByte,项目名称:nextgismanager,代码行数:32,代码来源:gxobgdialog.cpp
示例16: NS_PRECONDITION
NS_IMETHODIMP
nsSampleImpl::WriteValue(const char* aPrefix)
{
NS_PRECONDITION(aPrefix != nsnull, "null ptr");
if (! aPrefix)
return NS_ERROR_NULL_POINTER;
printf("%s %s\n", aPrefix, mValue);
// This next part illustrates the nsEmbedString:
nsEmbedString foopy;
foopy.Append(PRUnichar('f'));
foopy.Append(PRUnichar('o'));
foopy.Append(PRUnichar('o'));
foopy.Append(PRUnichar('p'));
foopy.Append(PRUnichar('y'));
const PRUnichar* f = foopy.get();
PRUint32 l = foopy.Length();
printf("%c%c%c%c%c %d\n", char(f[0]), char(f[1]), char(f[2]), char(f[3]), char(f[4]), l);
nsEmbedCString foopy2;
GetStringValue(foopy2);
//foopy2.AppendLiteral("foopy");
const char* f2 = foopy2.get();
PRUint32 l2 = foopy2.Length();
printf("%s %d\n", f2, l2);
return NS_OK;
}
开发者ID:Akin-Net,项目名称:mozilla-central,代码行数:32,代码来源:nsSample.cpp
示例17: GetValue
/*
** Executes OnChangeAction if action is set.
** If execute parameter is set to false, only updates old value with current value.
**
*/
void Measure::DoChangeAction(bool execute)
{
if (!m_OnChangeAction.empty() && m_ValueAssigned)
{
double newValue = GetValue();
const WCHAR* newStringValue = GetStringValue();
if (!newStringValue)
{
newStringValue = L"";
}
if (!m_OldValue)
{
m_OldValue = new MeasureValueSet(newValue, newStringValue);
}
else if (execute)
{
if (m_OldValue->IsChanged(newValue, newStringValue))
{
GetRainmeter().ExecuteCommand(m_OnChangeAction.c_str(), m_Skin);
}
}
else
{
m_OldValue->Set(newValue, newStringValue);
}
}
}
开发者ID:babaozhouy5,项目名称:rainmeter,代码行数:33,代码来源:Measure.cpp
示例18: switch
float Universal::GetFloat() const
{
switch (GetType())
{
case TypeString:
{
register const char * str = GetStringValue();
if (str[0] == '0' && str[1] == 'x')
{
register float ret = 0;
sscanf(str+2, "%x", &ret);
return (float)ret;
}
else
{
register float ret = 0.f;
sscanf(str, "%f", &ret);
return ret;
}
}
case TypeDecimal: return (float)value.l;
case TypeUnsigned: return (float)value.ul;
case TypeFloat: return value.f;
case TypeBool: return value.b ? 1.f:0.f;
//case TypeFloatVector: return vec_GetFloat(0);
};
return 0;
}
开发者ID:gejza,项目名称:Hoe3D,代码行数:28,代码来源:hoe_universal.cpp
示例19: ParseAttributeList
void Configuration::FillFromConnectString(const char* str, size_t len)
{
// Initializing map.
arguments.clear();
// Initializing DSN to empty string.
arguments[Key::dsn].clear();
// Ignoring terminating zero byte if present.
// Some Driver Managers pass zero-terminated connection string
// while others don't.
if (len && !str[len - 1])
--len;
ParseAttributeList(str, len, ';', arguments);
ArgumentMap::const_iterator it = arguments.find(Key::address);
if (it != arguments.end())
{
// Parsing address.
ParseAddress(it->second, endPoint);
}
else
{
endPoint.host = GetStringValue(Key::server, DefaultValue::server);
endPoint.port = static_cast<uint16_t>(GetIntValue(Key::port, DefaultValue::port));
}
}
开发者ID:TimmyTian,项目名称:ignite,代码行数:28,代码来源:configuration.cpp
示例20: while
void Configuration::FillFromConfigAttributes(const char * attributes)
{
// Initializing map.
arguments.clear();
size_t len = 0;
// Getting list length. List is terminated by two '\0'.
while (attributes[len] || attributes[len + 1])
++len;
++len;
ParseAttributeList(attributes, len, '\0', arguments);
ArgumentMap::const_iterator it = arguments.find(Key::address);
if (it != arguments.end())
{
// Parsing address.
ParseAddress(it->second, endPoint);
}
else
{
endPoint.host = GetStringValue(Key::server, DefaultValue::server);
endPoint.port = static_cast<uint16_t>(GetIntValue(Key::port, DefaultValue::port));
}
}
开发者ID:TimmyTian,项目名称:ignite,代码行数:27,代码来源:configuration.cpp
注:本文中的GetStringValue函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论