Ocean
Ocean::IO::ProjectFile Class Referencefinal

This class implements an project file loader. More...

Inheritance diagram for Ocean::IO::ProjectFile:

Public Types

typedef std::vector< std::string > Filenames
 Definition of a vector holding a filenames. More...
 

Public Member Functions

 ProjectFile ()=default
 Creates a new project file object. More...
 
 ProjectFile (const std::string &filename)
 Creates a new project file object by a given configuration file. More...
 
const Filenamesfilenames () const
 Returns the file types registered inside the project file. More...
 
bool fileExists () const
 Returns whether the project files exists. More...
 

Protected Attributes

Filenames filenames_
 Parsed project files. More...
 
bool fileExists_ = false
 State determining whether the project file exists. More...
 
- Protected Attributes inherited from Ocean::IO::FileConfig
FileValues values_
 Roots objects. More...
 
std::string filename_
 Filename of this config object. More...
 
- Protected Attributes inherited from Ocean::Config
Timestamp writeTimestamp_
 Holds the timestamp of the most recent write execution. More...
 

Additional Inherited Members

- Protected Types inherited from Ocean::IO::FileConfig
typedef std::multimap< std::string, FileValueFileValues
 Definition of a map mapping value names to value objects. More...
 
- Protected Types inherited from Ocean::Config
enum  ValueType {
  TYPE_INVALID , TYPE_UNDEFINED , TYPE_BOOL , TYPE_INT ,
  TYPE_NUMBER , TYPE_STRING , TYPE_MULTI_BOOL , TYPE_MULTI_INT ,
  TYPE_MULTI_NUMBER , TYPE_MULTI_STRING , TYPE_GROUP
}
 Definition of different value types. More...
 
- Protected Member Functions inherited from Ocean::IO::FileConfig
bool readSubValues (FileValues &values, Scanner &scanner, bool stopWithBrackets)
 Reads sub values. More...
 
 FileConfig ()
 Creates a new config object. More...
 
 FileConfig (const std::string &filename, const bool read=true)
 Creates a new config object by a given configuration file. More...
 
const std::string & filename () const
 Returns the config file. More...
 
bool setFilename (const std::string &filename, const bool read=true)
 Sets the filename of the new config objects. More...
 
bool read () override
 Reads / loads all values of this configuration. More...
 
bool write () override
 Writes / saves all values of this configuration. More...
 
unsigned int values () const override
 Returns the number of sub values. More...
 
unsigned int values (const std::string &name) const override
 Returns the number of sub values with a given name. More...
 
bool exist (const std::string &name) const override
 Returns whether this value holds at least one specified sub value. More...
 
FileValuevalue (const unsigned int index, std::string &name) override
 Returns a sub value specified by it's index. More...
 
bool value (const unsigned int index, std::string &name, Value **value) override
 Returns a sub value specified by it's index. More...
 
FileValuevalue (const std::string &name, const unsigned int index) override
 Returns a sub value specified by it's name and it's index if more than one value exists with the same name. More...
 
bool value (const std::string &name, const unsigned int index, Value **value) override
 Returns a sub value specified by it's name and it's index if more than one value exists with the same name. More...
 
FileValueadd (const std::string &name) override
 Adds a new sub value specified by it's name. More...
 
FileValueoperator[] (const std::string &name) override
 Returns a sub value specified by it's name. More...
 
bool isEmpty () const
 Returns whether this file configuration container does not hold any values. More...
 
- Protected Member Functions inherited from Ocean::Config
 Config ()
 Creates a new configuration toolkit. More...
 
 Config (const Config &config)=delete
 Disabled copy constructor. More...
 
Configoperator= (const Config &config)=delete
 Disabled copy operator. More...
 
virtual ~Config ()
 Destructs a configuration toolkit. More...
 
Timestamp writeTimestamp () const
 Returns the timestamp of the last write execution. More...
 
- Static Protected Member Functions inherited from Ocean::IO::FileConfig
static bool write (const FileValues &values, std::ostream &stream, unsigned int offset)
 Writes values to a stream with a given tab offset. More...
 
static bool writeTabs (std::ostream &stream, unsigned int offset)
 Writes a given number of tabs. More...
 
static FileValuenullValue ()
 Returns the default value holding no data. More...
 
static bool write (const FileValues &values, std::ostream &stream)
 Writes objects to a given output stream explicitly. More...
 
- Static Protected Member Functions inherited from Ocean::Config
static ValuenullValue ()
 Returns the default value holding no data. More...
 

Detailed Description

This class implements an project file loader.

Member Typedef Documentation

◆ Filenames

typedef std::vector<std::string> Ocean::IO::ProjectFile::Filenames

Definition of a vector holding a filenames.

Constructor & Destructor Documentation

◆ ProjectFile() [1/2]

Ocean::IO::ProjectFile::ProjectFile ( )
default

Creates a new project file object.

◆ ProjectFile() [2/2]

Ocean::IO::ProjectFile::ProjectFile ( const std::string &  filename)

Creates a new project file object by a given configuration file.

Parameters
filenameConfiguration file

Member Function Documentation

◆ fileExists()

bool Ocean::IO::ProjectFile::fileExists ( ) const
inline

Returns whether the project files exists.

Returns
True, if so

◆ filenames()

const ProjectFile::Filenames & Ocean::IO::ProjectFile::filenames ( ) const
inline

Returns the file types registered inside the project file.

Returns
Project files

Field Documentation

◆ fileExists_

bool Ocean::IO::ProjectFile::fileExists_ = false
protected

State determining whether the project file exists.

◆ filenames_

Filenames Ocean::IO::ProjectFile::filenames_
protected

Parsed project files.


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