当前位置: 首页>>代码示例>>C++>>正文


C++ Hashtable::begin方法代码示例

本文整理汇总了C++中Hashtable::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ Hashtable::begin方法的具体用法?C++ Hashtable::begin怎么用?C++ Hashtable::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Hashtable的用法示例。


在下文中一共展示了Hashtable::begin方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: db_insert_into_table

void db_insert_into_table( db::CDBAdapter& db, const String& table, Hashtable<String, String>& hashObject, const char* excludes = null)
{
    String cols = "";
    String quests = "";
    Vector<String> vals;

    for ( Hashtable<String,String>::iterator it = hashObject.begin();  it != hashObject.end(); ++it )
    {
        String key = it->first;
        String val  = it->second;

        if ( excludes && key.compare(excludes) == 0 )
            continue;

        if (cols.length() > 0)
        {
            cols += ',';
            quests += ',';
        }
    
        cols += key;
        quests += '?';
        vals.addElement( val );
    }

    String query = "insert into " + table + "(" + cols + ") values (" + quests + ")";

    db.executeSQLEx(query.c_str(), vals);
}
开发者ID:svnee,项目名称:rhodes,代码行数:29,代码来源:SyncClient.cpp

示例2: pop

void Tabid::pop() {
	if (symbols->size() == 0) return;
	Hashtable *bucket = (*symbols)[0];
	Hashtable::iterator iter = bucket->begin(),
			    end  = bucket->end();
	while (iter != end)
		delete iter->second;
	bucket->clear();
	symbols->pop_back();
	delete bucket;
}
开发者ID:Andre-Pires,项目名称:Compilers,代码行数:11,代码来源:Tabid.cpp

示例3: pop

void Tabid::pop() {
	if (symbols->size() == 0) return;
	Hashtable *bucket = symbols->back();
	Hashtable::iterator iter = bucket->begin(),
			    end  = bucket->end();
	while (iter != end) {
		delete &iter->first;
		delete iter->second;
		iter++;
	}
	bucket->clear();
	symbols->pop_back();
	delete bucket;
}
开发者ID:Andre-Pires,项目名称:Compilers,代码行数:14,代码来源:Tabid.cpp

示例4: rho_ringtone_manager_get_all

VALUE rho_ringtone_manager_get_all()
{
    LOG(INFO) + __FUNCTION__;
    
    CHoldRubyValue retval(rho_ruby_createHash());

#if _WIN32_WCE > 0x501

    Hashtable<String, String> ringtones;
    CRingtoneManager::getCRingtoneManager().getAllRingtones(ringtones);

    for (Hashtable<String, String>::iterator itr = ringtones.begin();
         itr != ringtones.end(); ++itr) {
        addStrToHash( retval, itr->first.c_str(), itr->second.c_str() );
    }
#endif
    
    return retval;
}
开发者ID:LittleForker,项目名称:rhodes,代码行数:19,代码来源:RingtoneManager.cpp

示例5:

/*static*/ String CJSONEntry::toJSON(const Hashtable<String,String>& hash)
{
    String resHash = "{ ";
    unsigned i = 0;
    for( rho::Hashtable<rho::String, rho::String>::const_iterator it = hash.begin(); it != hash.end(); ++it, ++i)
    {
        if (i > 0)
            resHash += ",";

        resHash += "\"";
        resHash += it->first;
        resHash += "\": ";
        resHash += CJSONEntry::quoteValue(it->second);
    }

    resHash += "}";

    return resHash;
}
开发者ID:nishimotz,项目名称:rhodes,代码行数:19,代码来源:JSONIterator.cpp

示例6: hashkeysCommand

Handle_ptr hashkeysCommand( CBuiltinAdapter *adapter, Context &ctx,
                 Environment *env, std::vector<Handle_ptr> args)
{
  if (1 != args.size())
    throw ArgumentCountException( 1, __FILE__, __LINE__);

  Hashtable *hashtable = asHashtable( args[0]);
  Hashtable::iterator pos = hashtable->begin();
  if (pos != hashtable->end()) {
    Handle_ptr listHead, current;
    listHead = current = ctx.factory->makeCons( ctx.factory->makeString( (*pos).first.c_str()));
    ++pos;
    for ( ; pos!=hashtable->end(); ++pos) {
      current->setCdr( ctx.factory->makeCons( ctx.factory->makeString( (*pos).first.c_str())));
      current = current->cdr();
    }
    return listHead;
  } else
    return ctx.NIL;
}
开发者ID:misaure,项目名称:lispel,代码行数:20,代码来源:hashcmd.cpp

示例7: loadBlobAttrs

void CDBAttrManager::loadBlobAttrs(CDBAdapter& db)
{
    loadAttrs(db, m_mapBlobAttrs, "blob_attribs");

    String strTriggerPrefix = "rhoSchemaTrigger_";
    IDBResult res = db.executeSQL( "SELECT name FROM sqlite_master WHERE type='trigger'" );
    Hashtable<String,int> mapTriggers;
    for ( ; !res.isEnd(); res.next() )
    {
        String strName = res.getStringByIdx(0);
        if ( !String_startsWith(strName, strTriggerPrefix) )
            continue;

        mapTriggers[strName.substr(strTriggerPrefix.length())] = 0;
    }

    for ( HashtablePtr< int, Hashtable<String,int>* >::iterator it = m_mapBlobAttrs.begin();  it != m_mapBlobAttrs.end(); ++it )
    {
        int nSrcID = it->first;

        IDBResult res = db.executeSQL("SELECT name FROM sources WHERE source_id=?", nSrcID);
        if ( res.isEnd() )
            continue;

        String strName = res.getStringByIdx(0);
        if ( !db.isTableExist(strName) )
            continue;

        Hashtable<String,int>& hashAttribs = *it->second;
        for ( Hashtable<String,int>::iterator itAttr = hashAttribs.begin();  itAttr != hashAttribs.end(); ++itAttr )
        {
            String strTriggerName = strName + "_" + itAttr->first;
            if ( !mapTriggers.containsKey(strTriggerName + "_delete") )
            {
                String strTrigger = String("CREATE TRIGGER ") + strTriggerPrefix + strTriggerName + "_delete BEFORE DELETE ON \"" + strName + "\" FOR EACH ROW \r\n"
                "   BEGIN \r\n"
                "       SELECT rhoOnDeleteSchemaRecord( OLD." + itAttr->first + ");\r\n"
                "   END;\r\n"
                ";";

                db.createTrigger(strTrigger);
            }else
                mapTriggers[strTriggerName + "_delete"] = 1;

            if ( !mapTriggers.containsKey(strTriggerName + "_update") )
            {
                String strTrigger = String("CREATE TRIGGER ") + strTriggerPrefix + strTriggerName + "_update BEFORE UPDATE ON \"" + strName + "\" FOR EACH ROW\r\n"
                "   BEGIN \r\n"
                "       SELECT rhoOnUpdateSchemaRecord( OLD." + itAttr->first + ", NEW." + itAttr->first + ");\r\n"
                "   END;\r\n"
                ";";

                db.createTrigger(strTrigger);
            }else
                mapTriggers[strTriggerName + "_update"] = 1;

        }
    }

    //Remove outdated triggers
    for ( Hashtable<String,int>::iterator itTriggers = mapTriggers.begin();  itTriggers != mapTriggers.end(); ++itTriggers )
    {
        if ( !itTriggers->second )
        {
            db.dropTrigger(strTriggerPrefix+itTriggers->first);
        }
    }
}
开发者ID:Yashi100,项目名称:rhodes3.3.2,代码行数:68,代码来源:DBAttrManager.cpp


注:本文中的Hashtable::begin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。