这篇教程C++ string_sprintf函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中string_sprintf函数的典型用法代码示例。如果您正苦于以下问题:C++ string_sprintf函数的具体用法?C++ string_sprintf怎么用?C++ string_sprintf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了string_sprintf函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: search_findtypeintsearch_findtype(const uschar *name, int len){int bot = 0;int top = lookup_list_count;while (top > bot) { int mid = (top + bot)/2; int c = Ustrncmp(name, lookup_list[mid]->name, len); /* If c == 0 we have matched the incoming name with the start of the search type name. However, some search types are substrings of others (e.g. nis and nisplus) so we need to check that the lengths are the same. The length of the type name cannot be shorter (else c would not be 0); if it is not equal it must be longer, and in that case, the incoming name comes before the name we are testing. By leaving c == 0 when the lengths are different, and doing a > 0 test below, this all falls out correctly. */ if (c == 0 && Ustrlen(lookup_list[mid]->name) == len) { if (lookup_list[mid]->find != NULL) return mid; search_error_message = string_sprintf("lookup type /"%.*s/" is not " "available (not in the binary - check buildtime LOOKUP configuration)", len, name); return -1; } if (c > 0) bot = mid + 1; else top = mid; }search_error_message = string_sprintf("unknown lookup type /"%.*s/"",len,name);return -1;}
开发者ID:Chaohua,项目名称:exim,代码行数:33,
示例2: checkexpandstatic uschar *checkexpand(uschar *s, address_item *addr, uschar *name, int type){uschar *t;uschar *ss = expand_string(s);if (ss == NULL) { addr->transport_return = FAIL; addr->message = string_sprintf("Expansion of /"%s/" failed in %s transport: " "%s", s, name, expand_string_message); return NULL; }if (type != cke_text) for (t = ss; *t != 0; t++) { int c = *t; if (mac_isprint(c)) continue; if (type == cke_hdr && c == '/n' && (t[1] == ' ' || t[1] == '/t')) continue; s = string_printing(s); addr->transport_return = FAIL; addr->message = string_sprintf("Expansion of /"%s/" in %s transport " "contains non-printing character %d", s, name, c); return NULL; }return ss;}
开发者ID:ArthasZRZ,项目名称:exim,代码行数:28,
示例3: rf_get_transportBOOLrf_get_transport(uschar *tpname, transport_instance **tpptr, address_item *addr, uschar *router_name, uschar *require_name){uschar *ss;BOOL expandable;transport_instance *tp;if (tpname == NULL) { if (require_name == NULL) return TRUE; addr->basic_errno = ERRNO_BADTRANSPORT; addr->message = string_sprintf("%s unset in %s router", require_name, router_name); return FALSE; }expandable = Ustrchr(tpname, '$') != NULL;if (*tpptr != NULL && !expandable) return TRUE;if (expandable) { ss = expand_string(tpname); if (ss == NULL) { addr->basic_errno = ERRNO_BADTRANSPORT; addr->message = string_sprintf("failed to expand transport " "/"%s/" in %s router: %s", tpname, router_name, expand_string_message); return FALSE; } }else ss = tpname;for (tp = transports; tp != NULL; tp = tp->next) { if (Ustrcmp(tp->name, ss) == 0) { DEBUG(D_route) debug_printf("set transport %s/n", ss); *tpptr = tp; return TRUE; } }addr->basic_errno = ERRNO_BADTRANSPORT;addr->message = string_sprintf("transport /"%s/" not found in %s router", ss, router_name);return FALSE;}
开发者ID:KMU-embedded,项目名称:mosbench-ext,代码行数:48,
示例4: ifMapTileType ConfigMgr::getMapTileTypeByName(const std::string& mapTileTypeName) { if (mapTileTypeName == "ocean") { return MapTileType::OCEAN; } else if (mapTileTypeName == "fish-grounds") { return MapTileType::FISH_GROUNDS; } else if (mapTileTypeName == "shallow-water") { return MapTileType::SHALLOW_WATER; } else if (mapTileTypeName == "shore-water") { return MapTileType::SHORE_WATER; } else if (mapTileTypeName == "shore-sand") { return MapTileType::SHORE_SAND; } else if (mapTileTypeName == "shore-grass") { return MapTileType::SHORE_GRASS; } else if (mapTileTypeName == "river") { return MapTileType::RIVER; } else if (mapTileTypeName == "mountain") { return MapTileType::MOUNTAIN; } else if (mapTileTypeName == "grass") { return MapTileType::GRASS; } else { throw ErrorInConfigException(string_sprintf(_("Illegal mapTileTypeName '%s'."), mapTileTypeName.c_str())); }}
开发者ID:OpenIsles,项目名称:OpenIsles,代码行数:32,
示例5: loadGoodsConfigMgr::ConfigMgr(std::string configPath) { try { loadGoods(configPath + "/goods.xml"); Log::info(_("Loaded goods.")); loadCarrierMapObjectTypes(configPath + "/carriers.xml"); Log::info(_("Loaded carrier mapObjectTypes.")); loadMapObjectTypes(configPath + "/map-objects.xml"); Log::info(_("Loaded mapObjectTypes.")); loadShipMapObjectTypes(configPath + "/ships.xml"); Log::info(_("Loaded ship mapObjectTypes.")); loadPopulationTiers(configPath + "/population-tiers.xml"); Log::info(_("Loaded population tiers.")); loadTilesConfig(configPath + "/tiles.xml"); Log::info(_("Loaded tiles.")); } catch (const rapidxml::parse_error& e) { // Fehler beim Parsen einer XML. // TODO e.what() kommt immer auf Englisch zurück. Das muss übersetzt werden. Idee: künstlich Phrasen anlegen throw ErrorInConfigException(string_sprintf(_("Error while loading the configuration: %s."), e.what())); }}
开发者ID:OpenIsles,项目名称:OpenIsles,代码行数:27,
示例6: sTempbool CScriptSystem::ExecuteFile(const char* sFileName, bool forceReload){ if (strlen(sFileName) <= 0) { return false; } CPathID sTemp(sFileName); ScriptFileListItor itor = this->findFile(sTemp); if (itor == m_dqLoadedFiles.end() || forceReload) { char sRealFileName[MAX_PATH]; string_sprintf(sRealFileName, "%s_compiled", sFileName); if (!_ExecuteFile(sFileName)) { return false; } if (itor == m_dqLoadedFiles.end()) { m_dqLoadedFiles.push_back(sTemp); } } return true;}
开发者ID:CodeBees,项目名称:behaviac,代码行数:28,
示例7: oracle_errorstatic uschar *oracle_error(struct cda_def *oracle_handle, int rc, uschar *msg){uschar tmp[1024];oerhms(oracle_handle, rc, tmp, sizeof(tmp));return string_sprintf("ORACLE %s: %s", msg, tmp);}
开发者ID:akissa,项目名称:exim,代码行数:7,
示例8: string_address_utf8_to_alabeluschar *string_address_utf8_to_alabel(const uschar * utf8, uschar ** err){uschar * l, * d;if (!*utf8) return string_copy(utf8);DEBUG(D_expand) debug_printf("addr from utf8 <%s>", utf8);for (const uschar * s = utf8; *s; s++) if (*s == '@') { l = string_copyn(utf8, s - utf8); if ( !(l = string_localpart_utf8_to_alabel(l, err)) || !(d = string_domain_utf8_to_alabel(++s, err)) ) return NULL; l = string_sprintf("%[email C++ string_strcasecmp函数代码示例 C++ string_size函数代码示例
|