Loading src/TNL/CMakeLists.txt +0 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ set( headers StaticVectorFor.h ) set( common_SOURCES FileName.cpp String.cpp ) set( tnl_SOURCES ${tnl_config_SOURCES} Loading src/TNL/FileName.cppdeleted 100644 → 0 +0 −98 Original line number Diff line number Diff line /*************************************************************************** FileName.cpp - description ------------------- begin : 2007/06/18 copyright : (C) 2007 by Tomas Oberhuber email : tomas.oberhuber@fjfi.cvut.cz ***************************************************************************/ /* See Copyright Notice in tnl/Copyright */ #include <sstream> #include <iomanip> #include <cstring> #include <cstdlib> #include <TNL/FileName.h> #include <TNL/String.h> #include <TNL/Math.h> namespace TNL { FileName::FileName() : index( 0 ), digitsCount( 5 ) { } FileName::FileName( const String& fileNameBase ) : fileNameBase( fileNameBase ), index( 0 ), digitsCount( 5 ) { } FileName::FileName( const String& fileNameBase, const String& extension ) : fileNameBase( fileNameBase ), extension( extension ), index( 0 ), digitsCount( 5 ) { } void FileName::setFileNameBase( const String& fileNameBase ) { this->fileNameBase = fileNameBase; } void FileName::setExtension( const String& extension ) { this->extension = extension; } void FileName::setIndex( const int index ) { this->index = index; } void FileName::setDigitsCount( const int digitsCount ) { this->digitsCount = digitsCount; } void FileName::setDistributedSystemNodeId( int nodeId ) { this->distributedSystemNodeId = "-"; this->distributedSystemNodeId += convertToString( nodeId ); } String FileName::getFileName() { std::stringstream stream; stream << this->fileNameBase << std::setw( this->digitsCount ) << std::setfill( '0' ) << this->index << this->distributedSystemNodeId << "." << this->extension; return String( stream.str().data() ); } String getFileExtension( const String fileName ) { int size = fileName. getLength(); int i = 1; while( fileName. getString()[ size - i ] != '.' && size > i ) i ++ ; String result; result.setString( fileName. getString(), size - i + 1 ); return result; } void removeFileExtension( String& fileName ) { int size = fileName. getLength(); int i = 1; while( fileName. getString()[ size - i ] != '.' && size > i ) i ++ ; fileName. setString( fileName. getString(), 0, i ); } } // namespace TNL src/TNL/FileName.h +2 −3 Original line number Diff line number Diff line Loading @@ -76,7 +76,6 @@ class FileName String fileNameBase, extension, distributedSystemNodeId; int index, digitsCount; }; } // namespace TNL Loading src/TNL/FileName.hpp +84 −0 Original line number Diff line number Diff line Loading @@ -8,10 +8,64 @@ /* See Copyright Notice in tnl/Copyright */ #pragma once #include <sstream> #include <iomanip> #include <TNL/FileName.h> #include <TNL/String.h> #include <TNL/Math.h> namespace TNL { inline FileName::FileName() : index( 0 ), digitsCount( 5 ) { } inline FileName::FileName( const String& fileNameBase ) : fileNameBase( fileNameBase ), index( 0 ), digitsCount( 5 ) { } inline FileName::FileName( const String& fileNameBase, const String& extension ) : fileNameBase( fileNameBase ), extension( extension ), index( 0 ), digitsCount( 5 ) { } inline void FileName::setFileNameBase( const String& fileNameBase ) { this->fileNameBase = fileNameBase; } inline void FileName::setExtension( const String& extension ) { this->extension = extension; } inline void FileName::setIndex( const int index ) { this->index = index; } inline void FileName::setDigitsCount( const int digitsCount ) { this->digitsCount = digitsCount; } inline void FileName::setDistributedSystemNodeId( int nodeId ) { this->distributedSystemNodeId = "-"; this->distributedSystemNodeId += convertToString( nodeId ); } template< typename Coordinates > void FileName:: Loading @@ -26,4 +80,34 @@ setDistributedSystemNodeId( const Coordinates& nodeId ) } } inline String FileName::getFileName() { std::stringstream stream; stream << this->fileNameBase << std::setw( this->digitsCount ) << std::setfill( '0' ) << this->index << this->distributedSystemNodeId << "." << this->extension; return String( stream.str().data() ); } inline String getFileExtension( const String fileName ) { int size = fileName. getLength(); int i = 1; while( fileName. getString()[ size - i ] != '.' && size > i ) i ++ ; String result; result.setString( fileName. getString(), size - i + 1 ); return result; } inline void removeFileExtension( String& fileName ) { int size = fileName. getLength(); int i = 1; while( fileName. getString()[ size - i ] != '.' && size > i ) i ++ ; fileName. setString( fileName. getString(), 0, i ); } } // namespace TNL Loading
src/TNL/CMakeLists.txt +0 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ set( headers StaticVectorFor.h ) set( common_SOURCES FileName.cpp String.cpp ) set( tnl_SOURCES ${tnl_config_SOURCES} Loading
src/TNL/FileName.cppdeleted 100644 → 0 +0 −98 Original line number Diff line number Diff line /*************************************************************************** FileName.cpp - description ------------------- begin : 2007/06/18 copyright : (C) 2007 by Tomas Oberhuber email : tomas.oberhuber@fjfi.cvut.cz ***************************************************************************/ /* See Copyright Notice in tnl/Copyright */ #include <sstream> #include <iomanip> #include <cstring> #include <cstdlib> #include <TNL/FileName.h> #include <TNL/String.h> #include <TNL/Math.h> namespace TNL { FileName::FileName() : index( 0 ), digitsCount( 5 ) { } FileName::FileName( const String& fileNameBase ) : fileNameBase( fileNameBase ), index( 0 ), digitsCount( 5 ) { } FileName::FileName( const String& fileNameBase, const String& extension ) : fileNameBase( fileNameBase ), extension( extension ), index( 0 ), digitsCount( 5 ) { } void FileName::setFileNameBase( const String& fileNameBase ) { this->fileNameBase = fileNameBase; } void FileName::setExtension( const String& extension ) { this->extension = extension; } void FileName::setIndex( const int index ) { this->index = index; } void FileName::setDigitsCount( const int digitsCount ) { this->digitsCount = digitsCount; } void FileName::setDistributedSystemNodeId( int nodeId ) { this->distributedSystemNodeId = "-"; this->distributedSystemNodeId += convertToString( nodeId ); } String FileName::getFileName() { std::stringstream stream; stream << this->fileNameBase << std::setw( this->digitsCount ) << std::setfill( '0' ) << this->index << this->distributedSystemNodeId << "." << this->extension; return String( stream.str().data() ); } String getFileExtension( const String fileName ) { int size = fileName. getLength(); int i = 1; while( fileName. getString()[ size - i ] != '.' && size > i ) i ++ ; String result; result.setString( fileName. getString(), size - i + 1 ); return result; } void removeFileExtension( String& fileName ) { int size = fileName. getLength(); int i = 1; while( fileName. getString()[ size - i ] != '.' && size > i ) i ++ ; fileName. setString( fileName. getString(), 0, i ); } } // namespace TNL
src/TNL/FileName.h +2 −3 Original line number Diff line number Diff line Loading @@ -76,7 +76,6 @@ class FileName String fileNameBase, extension, distributedSystemNodeId; int index, digitsCount; }; } // namespace TNL Loading
src/TNL/FileName.hpp +84 −0 Original line number Diff line number Diff line Loading @@ -8,10 +8,64 @@ /* See Copyright Notice in tnl/Copyright */ #pragma once #include <sstream> #include <iomanip> #include <TNL/FileName.h> #include <TNL/String.h> #include <TNL/Math.h> namespace TNL { inline FileName::FileName() : index( 0 ), digitsCount( 5 ) { } inline FileName::FileName( const String& fileNameBase ) : fileNameBase( fileNameBase ), index( 0 ), digitsCount( 5 ) { } inline FileName::FileName( const String& fileNameBase, const String& extension ) : fileNameBase( fileNameBase ), extension( extension ), index( 0 ), digitsCount( 5 ) { } inline void FileName::setFileNameBase( const String& fileNameBase ) { this->fileNameBase = fileNameBase; } inline void FileName::setExtension( const String& extension ) { this->extension = extension; } inline void FileName::setIndex( const int index ) { this->index = index; } inline void FileName::setDigitsCount( const int digitsCount ) { this->digitsCount = digitsCount; } inline void FileName::setDistributedSystemNodeId( int nodeId ) { this->distributedSystemNodeId = "-"; this->distributedSystemNodeId += convertToString( nodeId ); } template< typename Coordinates > void FileName:: Loading @@ -26,4 +80,34 @@ setDistributedSystemNodeId( const Coordinates& nodeId ) } } inline String FileName::getFileName() { std::stringstream stream; stream << this->fileNameBase << std::setw( this->digitsCount ) << std::setfill( '0' ) << this->index << this->distributedSystemNodeId << "." << this->extension; return String( stream.str().data() ); } inline String getFileExtension( const String fileName ) { int size = fileName. getLength(); int i = 1; while( fileName. getString()[ size - i ] != '.' && size > i ) i ++ ; String result; result.setString( fileName. getString(), size - i + 1 ); return result; } inline void removeFileExtension( String& fileName ) { int size = fileName. getLength(); int i = 1; while( fileName. getString()[ size - i ] != '.' && size > i ) i ++ ; fileName. setString( fileName. getString(), 0, i ); } } // namespace TNL