C++ main module for stochmagnet Package
1.0
|
this class describes the file system IO by default write on standart output More...
#include <CORE_IO.h>
Public Member Functions | |
CORE_IO () | |
build a CORE_IO More... | |
virtual | ~CORE_IO (void) |
destroy a CORE_IO More... | |
virtual tMemSize | getMemorySize () const override |
return the memory size of the class 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 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 | |
std::weak_ptr< CORE_Object > | mThis |
this class describes the file system IO by default write on standart output
|
inline |
build a CORE_IO
|
inlinevirtual |
destroy a CORE_IO
copy file
[in] | source | source file |
[in] | dest | destfile |
[in] | overwrite | : true to erase old file |
References CopyFile().
|
inlinestatic |
copy file
[in] | source | source file |
[in] | dest | destfile |
[in] | overwrite | : true to erase old file |
Referenced by CopyFile().
|
inlinestatic |
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 |
|
inlinestatic |
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 GetExtension(), core_functions::toLower(), and tString.
|
inlinestatic |
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 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.
|
inlinestatic |
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(), getMemorySize(), CORE_List< T, K, I >::getMemorySize(), CORE_OptionsReader::getMemorySize(), CORE_OutputFile::getMemorySize(), and CORE_Test::getMemorySize().
|
inlinestatic |
get the current path
get extension of the file
[in] | file | : name of the file |
Referenced by CopyFiles(), GetFiles(), and CORE_Test::testIO().
get path containing the file
[in] | file | : name of the file |
|
inlinestatic |
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 GetExtension(), core_functions::toLower(), and tString.
get all the files within the directory
[in] | path | path to get the content |
[out] | files | : all the files within the path |
Referenced by 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_Object.
Reimplemented in CORE_OutputFile.
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 |
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
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().
|
inlinestatic |
remove all files within a path
[in] | path | path in which the fils has to be remove remove |
References GetFiles().
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 GetFiles().
remove a file
[in] | file | file to remove |
remove an empty path
[in] | path | path to remove |
References RemovePath().
remove a path
[in] | path | path to remove |
[in] | force | true to remove the path even if not empty |
Referenced by RemovePath(), and CORE_Test::testIO().
_breif mov ethe path or file to another path or file
[in] | file | file to rename |
[in] | newFile | : new full name |
References Exists().
|
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().
|
privateinherited |
Referenced by CORE_Object::getConstSharedPointer(), CORE_Object::getSharedPointer(), and CORE_Object::setThis().