Gradient Augmented Levelset Implementation in CPU & GPU
FileUtils Class Reference

#include <file-utils.h>

Public Member Functions

 FileUtils ()
 
 ~FileUtils ()
 
void setRootDirectory (const std::string root_dir)
 
const std::string getRootDirectory () const
 
bool fileExists (const std::string file_name) const
 
bool removeFile (const std::string file_name) const
 
bool createDirectory (const std::string dir_name) const
 
bool removeDirectory (const std::string dir_name) const
 
template<typename T >
void write (const std::string file_name, const T &field)
 

Detailed Description

Class to handle file utilities, such as writing, reading.

Definition at line 47 of file file-utils.h.

Constructor & Destructor Documentation

FileUtils ( )

Default constructor.

Definition at line 43 of file file-utils.cc.

~FileUtils ( )

Destructor

Definition at line 45 of file file-utils.cc.

Member Function Documentation

bool createDirectory ( const std::string  dir_name) const

Create directory.

This function creates any non-existing directories in the path.

Parameters
dir_namename of the directory to create.
Returns
true if success, false otherwise.

Definition at line 65 of file file-utils.cc.

bool fileExists ( const std::string  file_name) const

Checks if file exists or not.

Parameters
file_namename of file with relative or absolute path.
Returns
true if exists, false otherwise.

Definition at line 51 of file file-utils.cc.

const std::string getRootDirectory ( ) const

Get root directory path.

Returns
root directory string.

Definition at line 49 of file file-utils.cc.

bool removeDirectory ( const std::string  dir_name) const

Remove directory path.

Parameters
dir_namename of the path to remove.
Returns
true if success, false otherwise.

Definition at line 76 of file file-utils.cc.

bool removeFile ( const std::string  file_name) const

Remove file.

Parameters
file_namename of file with relative or absolute path.
Returns
true if success, false otherwise.

Definition at line 58 of file file-utils.cc.

void setRootDirectory ( const std::string  root_dir)

Set root directory path.

Parameters
root_dirname of root directory.

Definition at line 47 of file file-utils.cc.

template void write< GALS::CPU::Array< GALS::CPU::Grid< double, 3 >, GALS::CPU::Vec3< double > > > ( const std::string  file_name,
const T &  field 
)

Write to file.

Parameters
file_namename of the file.
fieldvariable whose data will be written to a file.

Definition at line 84 of file file-utils.cc.


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