C++ main module for stochmagnet Package
1.0
|
this class describes a writing file More...
#include <CORE_OutputFile.h>
Public Member Functions | |
CORE_OutputFile () | |
build a CORE_OutputClass object More... | |
virtual | ~CORE_OutputFile (void) |
destroy a CORE_OutputClass object More... | |
virtual tMemSize | getMemorySize () const override |
return the memory size of the class More... | |
void | setPrecision (const tUSInt &p) |
set precision More... | |
tBoolean | open (const tString &fileName) |
open file fileName for writing More... | |
tBoolean | append (const tString &fileName) |
open file fileName for appending More... | |
void | close () |
close the file More... | |
tULInt | getCurrentIndex () const |
get the current index of the file More... | |
tBoolean | moveTo (const tULInt &index) |
move the current index position of the file to index More... | |
tBoolean | translate (const tLInt &dx) |
translate the current index position of the file More... | |
tBoolean | isEndOfFile () const |
test if the cursor is at the end of file More... | |
template<class T > | |
CORE_OutputFile & | operator<< (const T &obj) |
writing operator More... | |
template<class T > | |
std::shared_ptr< T > | getSharedPointer () |
return the shared pointer for this More... | |
template<class T > | |
std::shared_ptr< const T > | getConstSharedPointer () const |
return a const shared pointer for this More... | |
virtual tMemSize | getContentsMemorySize () const |
return nthe memory size of the included associations More... | |
template<class T > | |
tBoolean | isInstanceOf () const |
test if the clas T is an instance of this class More... | |
tString | getClassName () const |
return the name of the class More... | |
tString | getPointerString () const |
retrun the pointer of the class as a string More... | |
tString | getIdentityString () const |
retrun the string identification of the class More... | |
virtual tString | toString () const |
return the string representation of the object node More... | |
Static Public Member Functions | |
static CORE_UniquePointer< CORE_OutputFile > | New () |
create a new instance of CORE_OutputFile class More... | |
static tBoolean | IsFile (const tString &f) |
return true if the file is a regular file More... | |
static tBoolean | IsPath (const tString &p) |
return true if the path designed by p is a path More... | |
static tBoolean | Exists (const tString &f) |
return true if the file or the path exists More... | |
static tBoolean | CreatePath (const tString &path) |
create a path More... | |
static tBoolean | Rename (const tString &file, const tString &newFile) |
static tBoolean | RemovePath (const tString &path, const tBoolean &force) |
remove a path More... | |
static tBoolean | RemovePath (const tString &path) |
remove an empty path More... | |
static tBoolean | RemoveFile (const tString &file) |
remove a file More... | |
static void | RemoveAllFiles (const tString &path) |
remove all files within a path More... | |
static void | RemoveAllFiles (const tString &path, const tString &exts) |
remove all files with extension within the path More... | |
static tString | GetSystemPath (const tString &posix_path) |
get the system path corresponding to posix path More... | |
static void | GetPaths (const tString &path, std::vector< tString > &paths) |
get all the paths within the directory More... | |
static tString | GetPathName (const tString &aPath) |
get all the paths within the directory More... | |
static void | GetFiles (const tString &path, std::vector< tString > &files) |
get all the files within the directory More... | |
static void | GetFiles (const tString &path, const tString &exts, std::vector< tString > &files) |
get all the files within the directory with extension of the form .ext More... | |
static tBoolean | CopyFiles (const tString &sourcePath, const tString &exts, const tString &destPath, const tBoolean &overwrite) |
copy all the files with extension within the directory to destination path More... | |
static tBoolean | CopyFiles (const tString &sourcePath, const tString &destPath, const tBoolean &overwrite) |
copy all the files within the directory to destination path More... | |
static tBoolean | CopyFile (const tString &source, const tString &dest, const tBoolean &overwrite) |
copy file More... | |
static tBoolean | CopyFile (const tString &source, const tString &dest) |
copy file More... | |
static tBoolean | CopyPath (const tString &sourcePath, const tString &destPath) |
copy path More... | |
static void | GetContent (const tString &path, std::vector< tString > &content) |
get all the content files or paths within the directory More... | |
static tString | GetCurrentPath () |
get the current path More... | |
static tString | GetAbsolutePath (const tString &path) |
get the absolute path of the path More... | |
static tString | GetBaseName (const tString &file) |
get base name of the file More... | |
static tString | GetExtension (const tString &file) |
get extension of the file More... | |
static tString | GetPath (const tString &file) |
get path containing the file More... | |
static tString | GetFileName (const tString &file) |
get path containing the file More... | |
static tBoolean | EnableMemoryStack (const tBoolean &isMemoryChecked) |
enable the memory stack More... | |
static void | EnableMemoryStack () |
enable the memory stack More... | |
static void | DisableMemoryStack () |
disable the memory stack More... | |
static tBoolean | IsMemoryStackEnabled () |
return trur if the memory stack is enabled More... | |
static tString | MemoryStackToString () |
get the memory stack in string More... | |
static tIndex | GetRegisteredClassesNumber () |
get the memory stack in string More... | |
Private Member Functions | |
template<class T > | |
std::shared_ptr< T > | setThis (std::unique_ptr< T, CORE_Object::Delete > &up) |
set the shared pointer from an unique pointer More... | |
Private Attributes | |
tULInt | mLength |
std::unique_ptr< std::ofstream > | mFile |
std::weak_ptr< CORE_Object > | mThis |
this class describes a writing file
|
inline |
|
inlinevirtual |
|
inline |
close the file
References mFile.
Referenced by append(), SM_XDMF::close(), open(), and ~CORE_OutputFile().
|
inlinestaticinherited |
copy file
[in] | source | source file |
[in] | dest | destfile |
[in] | overwrite | : true to erase old file |
References CORE_IO::CopyFile().
|
inlinestaticinherited |
copy file
[in] | source | source file |
[in] | dest | destfile |
[in] | overwrite | : true to erase old file |
Referenced by CORE_IO::CopyFile().
|
inlinestaticinherited |
copy all the files within the directory to destination path
[in] | sourcePath | path to get the files with extension ext |
[in] | destPath | destinaton path |
[in] | overwrite | : true to erase old file |
|
inlinestaticinherited |
copy all the files with extension within the directory to destination path
[in] | sourcePath | path to get the files with extension ext |
[in] | exts | :xtensions of the file to search for example ".mov .avi " |
[in] | destPath | destinaton path |
[in] | overwrite | : true to erase old file |
References CORE_IO::GetExtension(), core_functions::toLower(), and tString.
|
inlinestaticinherited |
copy path
[in] | sourcePath | path to get the files with extension ext |
[in] | destPath | destinaton path |
create a path
[in] | path | create the path |
Referenced by CORE_Test::testIO().
|
inlinestaticinherited |
disable the memory stack
Referenced by CORE_Object::EnableMemoryStack().
|
inlinestaticinherited |
enable the memory stack
Referenced by CORE_Object::EnableMemoryStack(), and CORE_Run::SetDebugOptions().
|
inlinestaticinherited |
enable the memory stack
[in] | isMemoryChecked | : true to verify memory allocation of CORE_Object classes |
References CORE_Object::DisableMemoryStack(), CORE_Object::EnableMemoryStack(), and CORE_Object::IsMemoryStackEnabled().
return true if the file or the path exists
[in] | f | file or path to verify the existence |
Referenced by CORE_IO::Rename().
get the absolute path of the path
[in] | path | path to get the absolute path |
Referenced by CORE_OptionsReader::ReadPath().
get base name of the file
[in] | file | : name of the file |
Referenced by CORE_Test::testIO().
|
inlineinherited |
return the name of the class
Referenced by CORE_Object::getIdentityString(), and CORE_Test::testTypes().
|
inlineinherited |
return a const shared pointer for this
References CORE_Object::mThis.
|
inlinestaticinherited |
get all the content files or paths within the directory
[in] | path | path to get the content |
[out] | content | : all the content of the path files of paths |
|
inlinevirtualinherited |
return nthe memory size of the included associations
Reimplemented in CORE_VectorList< T, I >, CORE_VectorList< tString, CORE_StringsList >, CORE_ValArray< T, I >, CORE_ValArray< T, CORE_StdValArray< T > >, CORE_Run, CORE_PtrArray< T, I >, CORE_PtrArray< T, CORE_StdPtrArray< T > >, CORE_Field< T, K, D, S, I >, CORE_Field< T, K, D, CORE_StdPtrArray< T >, CORE_StdPtrField< T, K, D > >, CORE_Field< T, K, D, CORE_StdValArray< T >, CORE_StdValField< T, K, D > >, CORE_ClassFactory, SMS_STDUniformFunction, SMS_STDNormalFunction, SMS_BoostUniformFunction, SMS_BoostNormalFunction, SM_ZeemanOperator, SM_XDMF, SM_VTK, SM_System, SM_Output, SM_Operator, SM_Network, SM_DemagnetizedOperator, SM_Beam, CORE_StringsList, and CORE_Out.
Referenced by CORE_Out::getContentsMemorySize(), SM_Beam::getContentsMemorySize(), SM_Network::getContentsMemorySize(), SM_Operator::getContentsMemorySize(), SM_Output::getContentsMemorySize(), SM_System::getContentsMemorySize(), SM_VTK::getContentsMemorySize(), SMS_BoostNormalFunction::getContentsMemorySize(), SMS_BoostUniformFunction::getContentsMemorySize(), SMS_STDNormalFunction::getContentsMemorySize(), SMS_STDUniformFunction::getContentsMemorySize(), CORE_ClassFactory::getContentsMemorySize(), CORE_PtrArray< T, I >::getContentsMemorySize(), CORE_ValArray< T, I >::getContentsMemorySize(), CORE_VectorList< T, I >::getContentsMemorySize(), CORE_Object::getMemorySize(), SM_ConstantNoiseRateFunction::getMemorySize(), SM_InverseNoiseRateFunction::getMemorySize(), SM_LandauLifschitzFunction::getMemorySize(), SM_NoiseRateFunction::getMemorySize(), SM_Object::getMemorySize(), SM_StochasticFunction::getMemorySize(), SM_TemplatedNoiseRateFunction< DerivedClass >::getMemorySize(), SM_TimeStepper::getMemorySize(), SMS_BoostRandomFunction::getMemorySize(), CORE_Array< T, I >::getMemorySize(), CORE_Chrono::getMemorySize(), CORE_Collection< T, I >::getMemorySize(), CORE_IO::getMemorySize(), CORE_List< T, K, I >::getMemorySize(), CORE_OptionsReader::getMemorySize(), getMemorySize(), and CORE_Test::getMemorySize().
|
inline |
get the current index of the file
References mFile.
Referenced by translate().
|
inlinestaticinherited |
get the current path
get extension of the file
[in] | file | : name of the file |
Referenced by CORE_IO::CopyFiles(), CORE_IO::GetFiles(), and CORE_Test::testIO().
get path containing the file
[in] | file | : name of the file |
|
inlinestaticinherited |
get all the files within the directory with extension of the form .ext
[in] | path | path to get the content |
[in] | exts | extensions of the file to search for example ".mov .avi " |
[out] | files | : all the files within the path |
References CORE_IO::GetExtension(), core_functions::toLower(), and tString.
|
inlinestaticinherited |
get all the files within the directory
[in] | path | path to get the content |
[out] | files | : all the files within the path |
Referenced by CORE_IO::RemoveAllFiles(), and CORE_Test::testIO().
|
inlineinherited |
retrun the string identification of the class
References CORE_Object::getClassName(), and core_functions::pointerToString().
Referenced by CORE_Test::testArray(), CORE_Test::testField(), CORE_Test::testTypes(), CORE_Object::toString(), CORE_ClassFactory::toString(), and CORE_Field< T, K, D, S, I >::toString().
|
inlineoverridevirtual |
return the memory size of the class
Reimplemented from CORE_IO.
References CORE_Object::getContentsMemorySize().
get path containing the file
[in] | file | : name of the file |
Referenced by CORE_Test::testIO().
get all the paths within the directory
[in] | aPath | absolute path to get the content |
|
inlinestaticinherited |
get all the paths within the directory
[in] | path | path to get the content |
[out] | paths | all the paths within the path |
Referenced by CORE_Test::testIO().
|
inlineinherited |
retrun the pointer of the class as a string
References core_functions::pointerToString().
|
inlinestaticinherited |
get the memory stack in string
|
inlineinherited |
return the shared pointer for this
References CORE_Object::mThis.
get the system path corresponding to posix path
|
inline |
test if the cursor is at the end of file
References mFile.
return true if the file is a regular file
[in] | f | file to test |
|
inlineinherited |
test if the clas T is an instance of this class
Referenced by SM_Beam::templatedSimulate().
|
inlinestaticinherited |
return trur if the memory stack is enabled
Referenced by CORE_Object::EnableMemoryStack(), and main().
return true if the path designed by p is a path
[in] | p | path to test |
|
inlinestaticinherited |
get the memory stack in string
Referenced by main().
move the current index position of the file to index
[in] | index | new index to go |
References mFile, and mLength.
Referenced by translate().
|
inlinestatic |
create a new instance of CORE_OutputFile class
References CORE_OutputFile().
Referenced by SM_XDMF::SM_XDMF().
|
inline |
|
inlinestaticinherited |
remove all files within a path
[in] | path | path in which the fils has to be remove remove |
References CORE_IO::GetFiles().
|
inlinestaticinherited |
remove all files with extension within the path
[in] | path | path in which the fils has to be remove remove |
[in] | exts | extension of files to remove |
References CORE_IO::GetFiles().
remove a file
[in] | file | file to remove |
remove an empty path
[in] | path | path to remove |
References CORE_IO::RemovePath().
|
inlinestaticinherited |
remove a path
[in] | path | path to remove |
[in] | force | true to remove the path even if not empty |
Referenced by CORE_IO::RemovePath(), and CORE_Test::testIO().
|
inlinestaticinherited |
_breif mov ethe path or file to another path or file
[in] | file | file to rename |
[in] | newFile | : new full name |
References CORE_IO::Exists().
|
inline |
set precision
[in] | p | : precision for writting file |
|
inlineprivateinherited |
set the shared pointer from an unique pointer
[in,out] | up | unique pointer of the class at input, points to null pointer at output |
Method only calledby the friend class CORE_ClassFactory::NewSharedInstance()
References CORE_Object::mThis.
|
inlinevirtualinherited |
return the string representation of the object node
Reimplemented in SM_TimeStepper, SM_System, SM_StochasticFunction, SM_Network, SM_LandauLifschitzFunction, SM_Beam, CORE_Field< T, K, D, S, I >, CORE_Field< T, K, D, CORE_StdPtrArray< T >, CORE_StdPtrField< T, K, D > >, CORE_Field< T, K, D, CORE_StdValArray< T >, CORE_StdValField< T, K, D > >, CORE_Collection< T, I >, CORE_ClassFactory, and SM_NoiseRateFunction.
References CORE_Object::getIdentityString().
Referenced by SM_Run::run(), CORE_Collection< T, I >::toString(), SM_Beam::toString(), SM_Network::toString(), SM_StochasticFunction::toString(), SM_System::toString(), and SM_TimeStepper::toString().
translate the current index position of the file
dx | translator index |
References getCurrentIndex(), and moveTo().
|
private |
Referenced by append(), close(), getCurrentIndex(), isEndOfFile(), moveTo(), open(), and operator<<().
|
private |
Referenced by append(), CORE_OutputFile(), moveTo(), open(), and operator<<().
|
privateinherited |
Referenced by CORE_Object::getConstSharedPointer(), CORE_Object::getSharedPointer(), and CORE_Object::setThis().