本文整理汇总了C++中VecString类的典型用法代码示例。如果您正苦于以下问题:C++ VecString类的具体用法?C++ VecString怎么用?C++ VecString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VecString类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: eval
bool RedisClient::eval( CResult& values , const string& script , const VecString& keysVec ,
const VecString& argsVec )
{
BuildCommand cmd("EVAL");
string status;
int len = keysVec.size();
cmd << script << len;
for ( int i = 0 ; i < len ; i++ )
{
cmd << keysVec[i];
}
len = argsVec.size();
for ( int i = 0 ; i < len ; i++ )
{
cmd << argsVec[i];
}
return _getReply(values,cmd);
}
开发者ID:hehe1112,项目名称:MyProject,代码行数:21,代码来源:RedisClientScript.cpp
示例2: getSubkeyNames
VecString RegKey::getSubkeyNames() const
{
VecString v;
DWORD i = 0;
while(true)
{
DWORD len = 4096;
char name[len];
LONG result = RegEnumKeyEx( m_hkey, i++, name, &len, NULL, NULL, NULL, NULL );
if( result == ERROR_NO_MORE_ITEMS )
break;
if( result != ERROR_SUCCESS )
throw std::runtime_error( "error iterating keys in " + m_name );
v.push_back( String(name, name+len) );
}
return v;
}
开发者ID:CSE-Gulliver,项目名称:tinyos-2.x,代码行数:22,代码来源:motelist-win32.cpp
示例3: sort
bool RedisClient::sort( const string& key , VecString& values , const bool& desc )
{
BuildCommand cmd("SORT");
cmd << key;
if ( desc )
cmd << "DESC";
if ( _getArry(cmd, values) )
{
return values.size();
}
return false;
}
开发者ID:hehe1112,项目名称:MyProject,代码行数:14,代码来源:RedisClientKey.cpp
示例4: main
int main( VecString args )
{
bool showall = false;
bool compact = false;
//bool recovery = false;
for( VecString::size_type n=1; n!=args.size(); n++ )
{
StringRef opt = args[n];
if( opt == "-h" ) {
usage();
return 0;
}
else if( opt == "-l" ) {
showall = true;
}
else if( opt == "-c" ) {
compact = true;
}
else if( opt == "-c" ) {
compact = true;
}
else {
usage();
throw std::runtime_error("unknown command line option "+opt);
}
}
ListDevice devs = getDevices();
if( showall == false )
devs = getActiveDevices( devs );
devs.sort();
if( devs.empty() )
{
cout << "No devices found." << endl;
return 2;
}
else if( compact )
printDevices( devs );
else
prettyPrintDevices( devs );
return 0;
}
开发者ID:ribidi,项目名称:tinyos-2.x-tcts,代码行数:47,代码来源:motelist-win32.cpp
示例5: getRefCount
int getRefCount( const RegKey& dclass, const RegKey& key )
{
int refcnt = 0;
try
{
String symstr = key["Device Parameters"]("SymbolicName").data;
VecString sym = split( "\\#", symstr );
if( sym.size() >= 4 )
{
sym.erase( sym.begin(), sym.begin()+sym.size()-4 );
String devstr = sym[3] +"\\##?#" + join("#",sym) + "\\Control";
RegKey ctrl = dclass[devstr];
refcnt = strtol( ctrl("ReferenceCount").data.c_str(), NULL, 0 );
}
}
catch( std::runtime_error e ) { }
return refcnt;
}
开发者ID:CSE-Gulliver,项目名称:tinyos-2.x,代码行数:21,代码来源:motelist-win32.cpp
示例6: Utility_split
bool DatasetCommand::run()
{
VecString vecXlsxDir;
Utility_split(m_strFromDir.c_str(), ",", vecXlsxDir);
// 获取所有需要导出的Xlsx
VecString files;
for(auto i = 0; i < vecXlsxDir.size(); i++)
{
Utility_Find(vecXlsxDir[i].c_str(), files, true, "*.xlsx");
}
for(auto i = 0; i < files.size(); i++)
{
ParseXlsx(files[i].c_str());
}
// 导出代码
if(m_strCodeDir.size() > 0)
{
CreatDir((char*)m_strCodeDir.c_str());
std::string strDBDefine;
strDBDefine = ""
"#ifndef _DBDefine_Automake_H_\r\n"
"#define _DBDefine_Automake_H_\r\n";
strDBDefine += "\r\nstruct IDBBlock{};\r\n";
strDBDefine += "enum TableType\r\n{\r\n";
for(auto itrProps = m_mapTable.begin(); itrProps != m_mapTable.end(); ++itrProps)
{
auto vecPropertys = itrProps->second;
if(vecPropertys.size() == 0)
continue;
strDBDefine += "\tTT_";
std::string strName = itrProps->first;
strDBDefine += strupr((char*)strName.c_str());
strDBDefine += ",\r\n";
}
strDBDefine += "\tTT_Amount";
strDBDefine += "\r\n};\r\n\r\n";
for(auto itrProps = m_mapTableEnum.begin(); itrProps != m_mapTableEnum.end(); ++itrProps)
{
auto vecPropertys = itrProps->second;
if(vecPropertys.size() == 0)
continue;
std::string strTableName = itrProps->first.c_str();
strupr((char*)strTableName.c_str());
std::string strEnumName = "EDT_";
strEnumName+=strTableName;
strDBDefine += "enum EDT_";
strDBDefine += strTableName;
strDBDefine += "\r\n{\r\n";
for(auto i = 0; i < vecPropertys.size(); i++)
{
auto &enumData = vecPropertys[i];
strDBDefine += "\tEDT_";
strDBDefine += strTableName;
strDBDefine += "_";
strDBDefine += strupr((char*)enumData.strName.c_str());
strDBDefine += "\t = \t";
strDBDefine += strupr((char*)enumData.strType.c_str());
strDBDefine += ", //";
strDBDefine += strupr((char*)enumData.strDesc.c_str());
strDBDefine += "\r\n";
}
strDBDefine += "};\r\n\r\n";
}
for(auto itrProps = m_mapTable.begin(); itrProps != m_mapTable.end(); ++itrProps)
{
auto vecPropertys = itrProps->second;
if(vecPropertys.size() == 0)
continue;
strDBDefine += "struct DBData_";
strDBDefine += itrProps->first;
strDBDefine += " : IDBBlock";
strDBDefine += "\r\n{\r\n";
for(auto i = 0; i < vecPropertys.size(); i++)
{
strDBDefine += "\t";
if(vecPropertys[i].strType == "string")
{
strDBDefine += "const char*";
}
else
{
//.........这里部分代码省略.........
开发者ID:Johance2,项目名称:ShareModule,代码行数:101,代码来源:DatasetCommand.cpp
注:本文中的VecString类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论