本文整理汇总了C++中flux::string::find方法的典型用法代码示例。如果您正苦于以下问题:C++ string::find方法的具体用法?C++ string::find怎么用?C++ string::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类flux::string
的用法示例。
在下文中一共展示了string::find方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: t
XMLFile::Tag::Tag(const Flux::string n, Flux::string conts)
{
Name = n;
Content = conts;
for (unsigned i = 0; i < conts.size(); i++)
{
char c = conts.at(i);
if (c == '<' && conts.at(i+1) != '/' && conts.at(i+1) != ' ')
{
bool SelfContained = false;
std::string tag = "";
std::string contents = "";
for (unsigned j = 1;conts.at(i+j) != '>' && conts.at(i+j) != ' '; j++)
{
tag += conts.at(i+j);
}
for (unsigned o = 1; conts.at(i+o) != '>'; o++)
{
if ((conts.at(i+o) == '/' || conts.at(i+o) == '?') && conts.at(i+o+1) == '>')
{
SelfContained = true;
break;
}
}
if (!SelfContained)
{
for (unsigned k = conts.find('>',i)+1; k < conts.find("</"+tag,i); k++)
{
contents += conts.at(k);
}
}
Tag t(tag,contents);
for (unsigned l = 1; conts.at(i+l) != '>'; l++)
{
char cc = conts.at(i+l);
if (cc == '=' && conts.at(i+l+1) == '"')
{
std::string attribName = "";
std::string attribVal = "";
for (int m = -1; conts.at(i+l+m) != ' '; m--)
{
attribName.insert(0,1,conts.at(i+l+m));
}
for (unsigned nn = 2; conts.at(i+l+nn) != '"'; nn++)
{
attribVal += conts.at(i+l+nn);
}
Tag::Attribute att(attribVal);
t.Attributes[attribName] = att;
}
}
Tags[tag] = t;
i += contents.size();
}
}
}
示例2:
/** Construct the object, sets everything to 0
*/
sockaddrs::sockaddrs(const Flux::string &address)
{
this->clear();
if (!address.empty())
this->pton(address.find(':') != Flux::string::npos ? AF_INET6 : AF_INET, address);
}