Tuesday, June 4, 2013

from DB to C++ util::StringTokenizer

void ADEngine::updateConfigs(map<string, string>& prefMap){
    ADYardConfig* config = this->getYardConfig();
    ///< _deleteShiftCntrI
    bool deleteShiftCntrI = DEFAULT_DELETE_SHIFT_CNTR; ///< default value
    if(prefMap.find(DELETESHIFTCNTR)!=prefMap.end()){
        deleteShiftCntrI = atoi(prefMap[DELETESHIFTCNTR].data());
    }
///< _excludeCategory:set<string>
    string excludeCategories = DEFAULT_EXCLUDE_CATEGORY_C;
    if (prefMap.find(EXCLUDECATEGORYC) != prefMap.end()){
        excludeCategories = prefMap[EXCLUDECATEGORYC];
    }
    util::StringTokenizer stringTokenizer(excludeCategories,",");
    while(stringTokenizer.hasMoreTokens()){
        config->addExcludeCategory(stringTokenizer.nextToken());
    }
}

No comments:

Post a Comment