/////////////////////////////////////////////////////////////// // test.cpp - demonstrate calling routines in another file #include #include #include "../stringBase/stringBase.h" void main(int argc, char* argv[]) { const std::string title = "Using stringBase class"; std::cout << "\n " << title; std::cout << "\n " << std::string(title.length()+2,'=') << "\n"; stringBase elem1("aTag"); elem1.body("this is a body"); std::cout << "\n " << elem1 << "\n"; stringBase elem2("bTag"); elem2.body("another body"); std::cout << "\n " << elem2 << std::endl; stringBase* pDoc = new stringBase("anXMLdocument"); pDoc->body(elem1 + elem2); std::cout << "\n " << *pDoc << "\n\n"; std::ofstream out; out.open("temp.xml"); if(out.good()) out << *pDoc; else std::cout << "\n could not open temp.txt for writting"; delete pDoc; }