C++ mpi module for stochmagnet_main Package
Public Member Functions | Static Public Member Functions | List of all members
CORE_IO Class Reference

this class describes the file system IO by default write on standart output More...

#include <CORE_IO.h>

Inheritance diagram for CORE_IO:
Inheritance graph
[legend]
Collaboration diagram for CORE_IO:
Collaboration graph
[legend]

Public Member Functions

 CORE_IO ()
 build a CORE_IO
 
virtual ~CORE_IO (void)
 destroy a CORE_IO
 
virtual tMemSize getMemorySize () const override
 return the memory size of the class More...
 
- Public Member Functions inherited from CORE_Object
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 void GetFiles (const tString &path, const tString &prefix, 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 Public Member Functions inherited from CORE_Object
static tBoolean EnableMemoryStack (const tBoolean &isMemoryChecked)
 enable the memory stack More...
 
static void EnableMemoryStack ()
 enable the memory stack
 
static void DisableMemoryStack ()
 disable the memory stack
 
static tBoolean IsMemoryStackEnabled ()
 return trur if the memory stack is enabled
 
static tString MemoryStackToString ()
 get the memory stack in string More...
 
static tIndex GetRegisteredClassesNumber ()
 get the memory stack in string More...
 

Additional Inherited Members

- Protected Member Functions inherited from CORE_Object
 CORE_Object ()
 build an instance of the object
 
virtual ~CORE_Object ()
 destroy the instance of object std

 

Detailed Description

this class describes the file system IO by default write on standart output

Member Function Documentation

◆ CopyFile() [1/2]

static tBoolean CORE_IO::CopyFile ( const tString &  source,
const tString &  dest 
)
inlinestatic

copy file

Parameters
[in]sourcesource file
[in]destdestfile
Returns
true if the copy has succeeds

◆ CopyFile() [2/2]

static tBoolean CORE_IO::CopyFile ( const tString &  source,
const tString &  dest,
const tBoolean &  overwrite 
)
inlinestatic

copy file

Parameters
[in]sourcesource file
[in]destdestfile
[in]overwrite: true to erase old file
Returns
true if thecopy has succeeds

◆ CopyFiles() [1/2]

static tBoolean CORE_IO::CopyFiles ( const tString &  sourcePath,
const tString &  destPath,
const tBoolean &  overwrite 
)
inlinestatic

copy all the files within the directory to destination path

Parameters
[in]sourcePathpath to get the files with extension ext
[in]destPathdestinaton path
[in]overwrite: true to erase old file
Returns
true if the paths exists

◆ CopyFiles() [2/2]

static tBoolean CORE_IO::CopyFiles ( const tString &  sourcePath,
const tString &  exts,
const tString &  destPath,
const tBoolean &  overwrite 
)
inlinestatic

copy all the files with extension within the directory to destination path

Parameters
[in]sourcePathpath to get the files with extension ext
[in]exts:xtensions of the file to search for example ".mov .avi "
[in]destPathdestinaton path
[in]overwrite: true to erase old file
Returns
true if the paths exist

◆ CopyPath()

static tBoolean CORE_IO::CopyPath ( const tString &  sourcePath,
const tString &  destPath 
)
inlinestatic

copy path

Parameters
[in]sourcePathpath to get the files with extension ext
[in]destPathdestinaton path
Returns
true if the paths exists

◆ CreatePath()

static tBoolean CORE_IO::CreatePath ( const tString &  path)
inlinestatic

create a path

Parameters
[in]pathcreate the path
Returns
true if the path has been created correctly

◆ Exists()

static tBoolean CORE_IO::Exists ( const tString &  f)
inlinestatic

return true if the file or the path exists

Parameters
[in]ffile or path to verify the existence
Returns
true if the file/path exists

◆ GetAbsolutePath()

static tString CORE_IO::GetAbsolutePath ( const tString &  path)
inlinestatic

get the absolute path of the path

Parameters
[in]pathpath to get the absolute path
Returns
the absolute path of the path

◆ GetBaseName()

static tString CORE_IO::GetBaseName ( const tString &  file)
inlinestatic

get base name of the file

Parameters
[in]file: name of the file
Returns
the base name of the file

◆ GetContent()

static void CORE_IO::GetContent ( const tString &  path,
std::vector< tString > &  content 
)
inlinestatic

get all the content files or paths within the directory

Parameters
[in]pathpath to get the content
[out]content: all the content of the path files of paths

◆ GetCurrentPath()

static tString CORE_IO::GetCurrentPath ( )
inlinestatic

get the current path

Returns
the current path

◆ GetExtension()

static tString CORE_IO::GetExtension ( const tString &  file)
inlinestatic

get extension of the file

Parameters
[in]file: name of the file
Returns
the extention of the file of the form .ext

◆ GetFileName()

static tString CORE_IO::GetFileName ( const tString &  file)
inlinestatic

get path containing the file

Parameters
[in]file: name of the file
Returns
the path containing the file

◆ GetFiles() [1/3]

static void CORE_IO::GetFiles ( const tString &  path,
const tString &  exts,
std::vector< tString > &  files 
)
inlinestatic

get all the files within the directory with extension of the form .ext

Parameters
[in]pathpath to get the content
[in]extsextensions of the file to search for example ".mov .avi "
[out]files: all the absolute path for files within the path

◆ GetFiles() [2/3]

static void CORE_IO::GetFiles ( const tString &  path,
const tString &  prefix,
const tString &  exts,
std::vector< tString > &  files 
)
inlinestatic

get all the files within the directory with extension of the form .ext

Parameters
[in]pathpath to get the content
[in]prefixprefix of files
[in]extsextensions of the file to search for example ".mov .avi "
[out]files: all the files within the path

◆ GetFiles() [3/3]

static void CORE_IO::GetFiles ( const tString &  path,
std::vector< tString > &  files 
)
inlinestatic

get all the files within the directory

Parameters
[in]pathpath to get the content
[out]files: all the files within the path

◆ getMemorySize()

virtual tMemSize CORE_IO::getMemorySize ( ) const
inlineoverridevirtual

return the memory size of the class

Returns
the memory size of the class in bytes 1 octet = 1 byte 1 Ko = 1024 bytes 1 Mo = 1024 Ko 1 Go = 1024 Mo

Reimplemented from CORE_Object.

Reimplemented in CORE_OutputFile.

◆ GetPath()

static tString CORE_IO::GetPath ( const tString &  file)
inlinestatic

get path containing the file

Parameters
[in]file: name of the file
Returns
the path containing the file

◆ GetPathName()

static tString CORE_IO::GetPathName ( const tString &  aPath)
inlinestatic

get all the paths within the directory

Parameters
[in]aPathabsolute path to get the content
Returns
the name of the aPath

◆ GetPaths()

static void CORE_IO::GetPaths ( const tString &  path,
std::vector< tString > &  paths 
)
inlinestatic

get all the paths within the directory

Parameters
[in]pathpath to get the content
[out]pathsall the paths within the path

◆ GetSystemPath()

static tString CORE_IO::GetSystemPath ( const tString &  posix_path)
inlinestatic

get the system path corresponding to posix path

Returns
ystem path corresponding to posix path '/'->'\' for windows unchange for linux/mac

◆ IsFile()

static tBoolean CORE_IO::IsFile ( const tString &  f)
inlinestatic

return true if the file is a regular file

Parameters
[in]ffile to test
Returns
true if the file is regular

◆ IsPath()

static tBoolean CORE_IO::IsPath ( const tString &  p)
inlinestatic

return true if the path designed by p is a path

Parameters
[in]ppath to test
Returns
true if the path is regular

◆ RemoveAllFiles() [1/2]

static void CORE_IO::RemoveAllFiles ( const tString &  path)
inlinestatic

remove all files within a path

Parameters
[in]pathpath in which the file has to be remove

◆ RemoveAllFiles() [2/2]

static void CORE_IO::RemoveAllFiles ( const tString &  path,
const tString &  exts 
)
inlinestatic

remove all files with extension within the path

Parameters
[in]pathpath in which the fils has to be remove remove
[in]extsextension of files to remove

◆ RemoveFile()

static tBoolean CORE_IO::RemoveFile ( const tString &  file)
inlinestatic

remove a file

Parameters
[in]filefile to remove
Returns
true if the file has been removed correctly

◆ RemovePath() [1/2]

static tBoolean CORE_IO::RemovePath ( const tString &  path)
inlinestatic

remove an empty path

Parameters
[in]pathpath to remove
Returns
true if the path has been removed correctly

◆ RemovePath() [2/2]

static tBoolean CORE_IO::RemovePath ( const tString &  path,
const tBoolean &  force 
)
inlinestatic

remove a path

Parameters
[in]pathpath to remove
[in]forcetrue to remove the path even if not empty
Returns
true if the path has been removed correctly

◆ Rename()

static tBoolean CORE_IO::Rename ( const tString &  file,
const tString &  newFile 
)
inlinestatic

_breif mov ethe path or file to another path or file

Parameters
[in]filefile to rename
[in]newFile: new full name

The documentation for this class was generated from the following file: