00001 #ifndef CPPUNIT_TESTPATH_H 00002 #define CPPUNIT_TESTPATH_H 00003 00004 #include <cppunit/Portability.h> 00005 00006 #if CPPUNIT_NEED_DLL_DECL 00007 #pragma warning( push ) 00008 #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z 00009 #endif 00010 00011 #include <cppunit/portability/CppUnitDeque.h> 00012 #include <string> 00013 00014 CPPUNIT_NS_BEGIN 00015 00016 00017 class Test; 00018 00019 #if CPPUNIT_NEED_DLL_DECL 00020 // template class CPPUNIT_API std::deque<Test *>; 00021 #endif 00022 00023 00034 class CPPUNIT_API TestPath 00035 { 00036 public: 00041 TestPath(); 00042 00047 TestPath( Test *root ); 00048 00056 TestPath( const TestPath &otherPath, 00057 int indexFirst, 00058 int count = -1 ); 00059 00075 TestPath( Test *searchRoot, 00076 const std::string &pathAsString ); 00077 00081 TestPath( const TestPath &other ); 00082 00083 virtual ~TestPath(); 00084 00088 virtual bool isValid() const; 00089 00093 virtual void add( Test *test ); 00094 00098 virtual void add( const TestPath &path ); 00099 00105 virtual void insert( Test *test, int index ); 00106 00113 virtual void insert( const TestPath &path, int index ); 00114 00119 virtual void removeTests(); 00120 00125 virtual void removeTest( int index ); 00126 00131 virtual void up(); 00132 00136 virtual int getTestCount() const; 00137 00143 virtual Test *getTestAt( int index ) const; 00144 00149 virtual Test *getChildTest() const; 00150 00161 virtual std::string toString() const; 00162 00167 TestPath &operator =( const TestPath &other ); 00168 00169 protected: 00174 void checkIndexValid( int index ) const; 00175 00177 typedef CppUnitDeque<std::string> PathTestNames; 00178 00185 bool splitPathString( const std::string &pathAsString, 00186 PathTestNames &testNames ); 00187 00197 Test *findActualRoot( Test *searchRoot, 00198 const std::string &pathAsString, 00199 PathTestNames &testNames ); 00200 00201 protected: 00202 typedef CppUnitDeque<Test *> Tests; 00203 Tests m_tests; 00204 00205 }; 00206 00207 00208 CPPUNIT_NS_END 00209 00210 #endif // CPPUNIT_TESTPATH_H 00211