[Cppunit-cvs] cppunit2/include/cpptl conststring.py,NONE,1.1
Brought to you by:
blep
From: Baptiste L. <bl...@us...> - 2005-02-27 09:53:28
|
Update of /cvsroot/cppunit/cppunit2/include/cpptl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29614/include/cpptl Added Files: conststring.py Log Message: * small generator for operator + implementation. --- NEW FILE: conststring.py --- source = """inline CppTL::StringConcatenator operator +( %sleft, %sright ) { return CppTL::StringConcatenator( left, right ); } """ csz = 'const char *' std_string = 'const std::string &' types = [ csz, "const CppTL::ConstString &", "const CppTL::StringConcatenator &", "const CppTL::StringBuffer &" ] for left in xrange(0,len(types)): start = (left == 0) and 1 or 0 for right_type in types[start:]: print source % ( types[left], right_type ) print print '# ifndef CPPTL_CONSTSTRING_NO_STDSTRING' types = types[1:] + [std_string] for left_type in types: for right_type in types: if (left_type != std_string and right_type != std_string) or left_type == right_type: continue print source % ( left_type, right_type ) print '# endif' |