本文整理汇总了C++中STRINGLIST::end方法的典型用法代码示例。如果您正苦于以下问题:C++ STRINGLIST::end方法的具体用法?C++ STRINGLIST::end怎么用?C++ STRINGLIST::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类STRINGLIST
的用法示例。
在下文中一共展示了STRINGLIST::end方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
std::vector<std::string> InfoManager::GetLoadingAnnouncments() {
STRINGLIST l = g_ClusterManager.GetList(LISTPREFIX_LOADING_ANNOUNCMENTS);
STRINGLIST s;
if(l.size() == 0) {
s.push_back(StringUtil::Format(ReplaceBrandingPatterns("Welcome to ${GameName} - ${Edition}. You can set your own <b>Loading Announcements</b> by creating and adding multiple elements to the list <b>'%s'</b> in the Redis database."), LISTPREFIX_LOADING_ANNOUNCMENTS.c_str()));
}
else {
for(auto it = l.begin(); it != l.end(); ++it) {
s.push_back(ReplaceBrandingPatterns(*it));
}
}
return s;
}
示例2: Filename
const char * Platform::Basename(const char *path)
{
STRINGLIST v;
const std::string p = Filename(path);
const std::string d(1, PLATFORM_FOLDERVALID);
Util::Split(p, ".", v);
if(v.size() == 0)
return "";
else {
std::string t;
v.erase(v.end() - 1);
Util::Join(v, d.c_str(), t);
return t.c_str();
}
}
示例3: Init
bool InfoManager::Init() {
TextFileEntityReader ter(Platform::JoinPath(Platform::JoinPath(g_Config.ResolveStaticDataPath(), "Data"), "Tips.txt" ), Case_None, Comment_Semi);
ter.Start();
if (!ter.Exists())
return false;
ter.Key("", "", true);
ter.Index("ENTRY");
STRINGLIST sections = ter.Sections();
int i = 0;
for (auto a = sections.begin(); a != sections.end(); ++a) {
ter.PushSection(*a);
Tip t;
t.mID = ++i;
if (!t.EntityKeys(&ter) || !t.ReadEntity(&ter))
return false;
mTips.push_back(t);
ter.PopSection();
}
ter.End();
std::string filename = Platform::JoinPath(Platform::JoinPath(g_Config.ResolveStaticDataPath(), "Data"), "Game.txt" );
FileReader lfr;
if (lfr.OpenText(filename.c_str()) != Err_OK) {
g_Logs.data->error("Could not open configuration file: %v", filename);
return false;
}
else {
static char Delimiter[] = { '=', 13, 10 };
lfr.Delimiter = Delimiter;
lfr.CommentStyle = Comment_Semi;
while (lfr.FileOpen() == true) {
int r = lfr.ReadLine();
if (r > 0) {
lfr.SingleBreak("=");
char *NameBlock = lfr.BlockToString(0);
if (strcmp(NameBlock, "GameName") == 0) {
mGameName = lfr.BlockToStringC(1, 0);
} else if (strcmp(NameBlock, "Edition") == 0) {
mEdition = lfr.BlockToStringC(1, 0);
} else if (strcmp(NameBlock, "StartZone") == 0) {
mStartZone = lfr.BlockToInt(1);
} else if (strcmp(NameBlock, "StartX") == 0) {
mStartX = lfr.BlockToInt(1);
} else if (strcmp(NameBlock, "StartY") == 0) {
mStartY = lfr.BlockToInt(1);
} else if (strcmp(NameBlock, "StartZ") == 0) {
mStartZ = lfr.BlockToInt(1);
} else if (strcmp(NameBlock, "StartRotation") == 0) {
mStartRotation = lfr.BlockToInt(1);
}
else {
g_Logs.data->error("Unknown identifier [%v] in config file [%v]",
lfr.BlockToString(0), filename);
}
}
}
lfr.CloseCurrent();
}
return true;
}