1.1.0
CCC
 
ASerializable Class Referenceabstract

#include <ASerializable.hpp>

Inheritance diagram for ASerializable:
AAnam AMesh ANeigh Db Faults FracEnviron FracFamily FracFault Model Polygons PolyLine2D Rule Table Vario

Public Member Functions

 ASerializable ()
 
 ASerializable (const ASerializable &r)
 
ASerializableoperator= (const ASerializable &r)
 
virtual ~ASerializable ()
 
bool deserialize (std::istream &is, bool verbose=true)
 
bool serialize (std::ostream &os, bool verbose=true) const
 
bool dumpToNF (const String &neutralFilename, bool verbose=false) const
 

Static Public Member Functions

static String buildFileName (int status, const String &filename, bool ensureDirExist=false)
 
static String getHomeDirectory (const String &sub="")
 
static String getWorkingDirectory ()
 
static String getTestData (const String &subdir, const String &filename)
 
static String getFileIdentity (const String &filename, bool verbose=false)
 
static void setContainerName (bool useDefault, const String &containerName="", bool verbose=false)
 
static void unsetContainerName ()
 
static void setPrefixName (const String &prefixName)
 
static void unsetPrefixName ()
 
static const StringgetContainerName ()
 
static const StringgetPrefixName ()
 
static bool createDirectory (const String &dir)
 
static String getExecDirectory ()
 
static String getDirectory (const String &path)
 

Constructor & Destructor Documentation

ASerializable::ASerializable ( )
ASerializable::ASerializable ( const ASerializable r)

Copy constructor: don't copy temporary file info

ASerializable::~ASerializable ( )
virtual

Member Function Documentation

String ASerializable::buildFileName ( int  status,
const String filename,
bool  ensureDirExist = false 
)
static

Build a standard filename for Read or Write operation

Parameters
status1 for Read and 2 for Write
filenameName of the filename (see remark)
ensureDirExistWhen TRUE, the Directory is created if not already existing
Returns
bool ASerializable::createDirectory ( const String dir)
static

Cross platform way to create a directory (or ensure its existence)

bool ASerializable::deserialize ( std::istream &  is,
bool  verbose = true 
)
bool ASerializable::dumpToNF ( const String neutralFilename,
bool  verbose = false 
) const
const String & ASerializable::getContainerName ( )
static
String ASerializable::getDirectory ( const String path)
static

Cross-platform way to get parent directory from a path. Returned directory contains trailing separator.

String ASerializable::getExecDirectory ( )
static

Cross platform way to get executable directory. Returned directory contains trailing separator

String ASerializable::getFileIdentity ( const String filename,
bool  verbose = false 
)
static

Returns the Identity of a Neutral File which allows knowing its type

Parameters
filenameName of the Neutral File
verboseVerbose flag
Returns
String ASerializable::getHomeDirectory ( const String sub = "")
static
const String & ASerializable::getPrefixName ( )
static
String ASerializable::getTestData ( const String subdir,
const String filename 
)
static

This method returns the absolute path to a Test Data file This can only be used in non-regression test (NOT in any Python or R stand-alone script)

Parameters
subdirSub directory (in doc/data folder) containing the required file
filenameName of the required data file
Returns
String ASerializable::getWorkingDirectory ( )
static
ASerializable & ASerializable::operator= ( const ASerializable r)

Assignment operator: don't copy temporary file info

bool ASerializable::serialize ( std::ostream &  os,
bool  verbose = true 
) const
void ASerializable::setContainerName ( bool  useDefault,
const String containerName = "",
bool  verbose = false 
)
static

Set the Container Directory Name (do not forget trailing separator "/")

Parameters
useDefaultTrue if the user wants to use automated ContainerName
  • defined with the global variable PYGTSLEARN_DIR
  • or using HOME/gstlearn_dir
containerNameName or "" for current location
verboseVerbose flag
void ASerializable::setPrefixName ( const String prefixName)
static
void ASerializable::unsetContainerName ( )
static

This enables un-defining the Container Name. Then files will be saved on current Directory

void ASerializable::unsetPrefixName ( void  )
static

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