#ifndef XMLTOOLDIRHH #define XMLTOOLDIRHH #include "ExpatInterface/Element.h" namespace xmlTool { class Directory { private: const xml::Element & _elt; // WIPTMNCH const std::string _tag; // IWNCH const std::string _attName; // IWNCH std::vector _cwd; // WTPTMNCH IMCH public: Directory(const xml::Element & elt, // WIPTMNCH const std::string & tag, // WIPTWNCH const std::string & attName);// WIPTWNCH // Within element "elt" we take // "tag" elements to be directories // distinguished by their attribute "attName". // The user guarantees that elt itself may be treated as // a "root directory", even if it is not of type "tag" itself. // This will be our start directory. const xml::Element & getCurDirElt() const; // WIPTMNCH ACOF const std::string getCurDirName() const; // WIRMCH but happy ACOF const std::vector getDirNames() const;//WIPTMCH but happy ACOF // Changing directories: // This method returns true if is was possible to change // directory as requested, and false otherwise. // Valid newDirNames are: // string("") // Goes to the root // string("/") // Also goes to the root // string("..") // Goes one directory back. If you are // already in the root, it goes nowhere. // It will still return true though. // string("blah") // This is valid if there is a // directory called "blah" in the current dir. const bool changeDir(const std::string & newDirName=std::string("")); // WIPTCNCH NACF }; } #endif