Definition at line 54 of file XmlRep.h.
◆ XmlStream()
◆ addNextTag()
Definition at line 146 of file XmlRep.cpp.
References closing, XmlElement::endLoc, XmlElement::name, opening, selfClosing, XmlElement::startLoc, and XmlElement::type.
Referenced by XmlStream().
148 std::streampos start;
154 int isProcessingInstruction = 0;
156 int isClosingTag = 0;
157 int isSelfClosing = 0;
159 int openCaretFound = 0;
160 int closeCaretFound = 0;
162 int numSingleQuotes = 0;
163 int numDoubleQuotes = 0;
164 while ((current =
stream_->get()) && current != EOF && closeCaretFound == 0)
181 isProcessingInstruction = 1;
183 if (one ==
'!' && two ==
'-' && three ==
'-')
195 if (openCaretFound == 1)
201 else if (current ==
'\"')
205 else if (current ==
'>')
208 if (numSingleQuotes % 2 == 0 && numDoubleQuotes % 2 == 0)
215 if (prev ==
'-' && twoprev ==
'-')
245 if (isProcessingInstruction == 0 && isComment == 0)
251 if (isSelfClosing == 1)
255 else if (isClosingTag == 1)
268 if (isProcessingInstruction == 1 || isComment == 1)
std::vector< XmlElement > elements
std::string getTagName(const std::string &tag, tagType type) const
std::string getTag(const XmlElement &e) const
◆ checkForPOD()
◆ endComment()
int endComment |
( |
long |
position, |
|
|
long |
length |
|
) |
| const |
|
private |
Definition at line 75 of file XmlRep.cpp.
78 std::streampos curLoc =
stream_->tellg();
79 if ((length - position) > 3)
83 if (strncmp(buf,
"-->", 3) == 0)
◆ findChildElements()
void findChildElements |
( |
int |
start, |
|
|
std::vector< int > & |
childIndices, |
|
|
int & |
podIndex |
|
) |
| const |
◆ getStreamSection()
string getStreamSection |
( |
const std::streampos & |
start, |
|
|
const std::streampos & |
end |
|
) |
| const |
Definition at line 276 of file XmlRep.cpp.
Referenced by getTag().
279 std::streampos curLoc =
stream_->tellg();
281 std::string result(end - start,
'\0');
283 stream_->read(result.data(), end - start);
◆ getTag() [1/2]
◆ getTag() [2/2]
string getTag |
( |
int |
i | ) |
const |
Definition at line 386 of file XmlRep.cpp.
References elements, and getTag().
390 cerr <<
"requested a tag index past the end of the vector" << endl;
std::vector< XmlElement > elements
std::string getTag(const XmlElement &e) const
◆ getTagName()
string getTagName |
( |
const std::string & |
tag, |
|
|
tagType |
type |
|
) |
| const |
|
private |
Definition at line 18 of file XmlRep.cpp.
References closing, and selfClosing.
22 size_t spaceLoc = tagstr.find(
" ");
23 size_t closeLoc = tagstr.find(
'>');
24 size_t slashLoc = string::npos;
28 slashLoc = tagstr.find(
"/");
31 int endChar = tagstr.size();
32 if (spaceLoc != string::npos)
36 if (closeLoc < endChar && closeLoc != string::npos)
40 if (slashLoc < endChar && slashLoc != string::npos)
48 tagName = tagstr.substr(2, endChar);
53 tagName = tagstr.substr(1, endChar);
◆ listAll()
Definition at line 333 of file XmlRep.cpp.
References closing, opening, pod, and selfClosing.
335 for (
int i = 0; i <
elements.size(); i++)
337 std::cout << i <<
" ";
341 std::cout <<
"opening, name = " <<
elements[i].name << std::endl;
345 std::cout <<
"closing, name = " <<
elements[i].name << std::endl;
349 std::cout <<
"selfClosing, name = " <<
elements[i].name << std::endl;
353 std::cout <<
"POD" << std::endl;
std::vector< XmlElement > elements
◆ startComment()
int startComment |
( |
long |
position, |
|
|
long |
length |
|
) |
| const |
|
private |
Definition at line 58 of file XmlRep.cpp.
60 int isCommentStart = 0;
61 std::streampos curLoc =
stream_->tellg();
62 if ((length - position) > 4)
66 if (strncmp(buf,
"<!--", 4) == 0)
72 return isCommentStart;
◆ elements
◆ stream_
The documentation for this class was generated from the following files:
- /home/pk7/projects/qmc/for_cron_doxygen/qmcpack/src/QMCTools/XmlRep.h
- /home/pk7/projects/qmc/for_cron_doxygen/qmcpack/src/QMCTools/XmlRep.cpp