本文整理汇总了C++中CStdString::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ CStdString::push_back方法的具体用法?C++ CStdString::push_back怎么用?C++ CStdString::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStdString
的用法示例。
在下文中一共展示了CStdString::push_back方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
CStdString CID3Tag::ParseMP3Genre(const CStdString& str) const
{
if (!m_dll.IsLoaded())
m_dll.Load();
CStdString strTemp = str;
set<CStdString> setGenres;
while (!strTemp.IsEmpty())
{
// remove any leading spaces
int i = strTemp.find_first_not_of(" ");
if (i > 0) strTemp.erase(0, i);
// pull off the first character
char p = strTemp[0];
// start off looking for (something)
if (p == '(')
{
strTemp.erase(0, 1);
// now look for ((something))
p = strTemp[0];
if (p == '(')
{
// remove ((something))
i = strTemp.find_first_of("))");
strTemp.erase(0, i + 2);
}
}
// no parens, so we have a start of a string
// push chars into temp string until valid terminator found
// valid terminators are ) or , or ;
else
{
CStdString t;
while ((!strTemp.IsEmpty()) && (p != ')') && (p != ',') && (p != ';'))
{
strTemp.erase(0, 1);
t.push_back(p);
p = strTemp[0];
}
// loop exits when terminator is found
// be sure to remove the terminator
strTemp.erase(0, 1);
// remove any leading or trailing white space
// from temp string
t.Trim();
if (!t.size()) continue;
// if the temp string is natural number try to convert it to a genre string
if (StringUtils::IsNaturalNumber(t))
{
id3_ucs4_t* ucs4=m_dll.id3_latin1_ucs4duplicate((id3_latin1_t*)t.c_str());
const id3_ucs4_t* genre=m_dll.id3_genre_name(ucs4);
m_dll.id3_ucs4_free(ucs4);
t=ToStringCharset(genre, ID3_FIELD_TEXTENCODING_ISO_8859_1);
}
// convert RX to Remix as per ID3 V2.3 spec
else if ((t == "RX") || (t == "Rx") || (t == "rX") || (t == "rx"))
{
t = "Remix";
}
// convert CR to Cover as per ID3 V2.3 spec
else if ((t == "CR") || (t == "Cr") || (t == "cR") || (t == "cr"))
{
t = "Cover";
}
// insert genre name in set
setGenres.insert(t);
}
}
// return a " / " seperated string
CStdString strGenre;
set<CStdString>::iterator it;
for (it = setGenres.begin(); it != setGenres.end(); it++)
{
CStdString strTemp = *it;
if (!strGenre.IsEmpty())
strGenre += g_advancedSettings.m_musicItemSeparator;
strGenre += strTemp;
}
return strGenre;
}