We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- C++
- Strings
- Attribute Parser
- Discussions
Attribute Parser
Attribute Parser
Sort by
recency
|
438 Discussions
|
Please Login in order to post a comment
include
include
include
include
include
include "memory"
include "algorithm"
using namespace std;
typedef struct attribute{ string name; string value; }attribute;
class TAG{ public: TAG* getChild(const string& _childName){ TAG* child; for(auto& item: m_child){ if(item->m_name == _childName){ child = item; } } return child; } string getAttribute(const string& _name){ for(const auto& i: m_attribute){ if(_name == i.name) return i.value; } return "Not Found!"; } bool m_isRootTag = true; string m_name; vector m_child; vector m_attribute; };
vector g_tagList; vector g_tagScope;
string getEndOfTag(string _tag){ string EOTag; EOTag.append("/").append(_tag); return EOTag; }
string trimTagInputString(string _string){ auto tempString(std::move(_string)); for(char & i : tempString){ if(i == '>' || i == '<' || i == '=' || i == '"'){ i = ' '; } } return tempString; }
TAG* getTagByName(const string& _name){ TAG* tag = (TAG*)malloc(sizeof(TAG)); for(auto& item: g_tagList){ if(item.m_name == _name){ tag = &item; return tag; } } return tag; }
string getTagAttribute(const vector& _tagSerial, const string& _attName){ string att("Not Found!");
}
int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */
}
include
include
include
include
include
include
include
include
using namespace std;
std::vector split(const std::string &s, char delim) { std::vector tokens; std::stringstream ss(s); std::string token; while (std::getline(ss, token, delim)) { tokens.push_back(token); } return tokens; }
int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int n,q; cin>>n>>q; vector words; vector headers; for(int i=0;i<=n;i++){ string temp; getline(cin,temp);
}
Easy C++ Metgod ::