本文整理汇总了C++中OTString::At方法的典型用法代码示例。如果您正苦于以下问题:C++ OTString::At方法的具体用法?C++ OTString::At怎么用?C++ OTString::At使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OTString
的用法示例。
在下文中一共展示了OTString::At方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessXMLNode
int OTSignedFile::ProcessXMLNode(irr::io::IrrXMLReader*& xml)
{
int nReturnVal = 0;
// Here we call the parent class first.
// If the node is found there, or there is some error,
// then we just return either way. But if it comes back
// as '0', then nothing happened, and we'll continue executing.
//
// -- Note you can choose not to call the parent if
// you don't want to use any of those xml tags.
// As I do below, in the case of OTAccount.
//if (nReturnVal = OTContract::ProcessXMLNode(xml))
// return nReturnVal;
if (!strcmp("signedFile", xml->getNodeName()))
{
m_strVersion = xml->getAttributeValue("version");
m_strPurportedLocalDir = xml->getAttributeValue("localDir");
m_strPurportedFilename = xml->getAttributeValue("filename");
// ---------------------
nReturnVal = 1;
}
else if (!strcmp("filePayload", xml->getNodeName()))
{
// go to the next node and read the text.
xml->read();
if (EXN_TEXT == xml->getNodeType())
{
OTString strNodeData = xml->getNodeData();
// Sometimes the XML reads up the data with a prepended newline.
// This screws up my own objects which expect a consistent in/out
// So I'm checking here for that prepended newline, and removing it.
char cNewline;
if (strNodeData.At(0, cNewline))
{
OTASCIIArmor ascNodeData;
if ('\n' == cNewline)
{
ascNodeData.Set(strNodeData.Get() + 1);
ascNodeData.GetString(m_strSignedFilePayload, true); // linebreaks = true
}
else
{
ascNodeData.Set(strNodeData.Get());
ascNodeData.GetString(m_strSignedFilePayload, true); // linebreaks = true
}
}
}
else {
fprintf(stderr, "Error in OTSignedFile::ProcessXMLNode: filePayload field without value.\n");
return (-1); // error condition
}
return 1;
}
return nReturnVal;
}