Ocean
Loading...
Searching...
No Matches
ProjectFile.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_IO_PROJECT_CONFIG_H
9#define META_OCEAN_IO_PROJECT_CONFIG_H
10
11#include "ocean/io/FileConfig.h"
12
13namespace Ocean
14{
15
16namespace IO
17{
18
19/**
20 * This class implements an project file loader.
21 * @ingroup io
22 */
23class OCEAN_IO_EXPORT ProjectFile final : protected FileConfig
24{
25 public:
26
27 /**
28 * Definition of a vector holding a filenames.
29 */
30 typedef std::vector<std::string> Filenames;
31
32 public:
33
34 /**
35 * Creates a new project file object.
36 */
37 ProjectFile() = default;
38
39 /**
40 * Creates a new project file object by a given configuration file.
41 * @param filename Configuration file
42 */
43 ProjectFile(const std::string& filename);
44
45 /**
46 * Returns the file types registered inside the project file.
47 * @return Project files
48 */
49 inline const Filenames& filenames() const;
50
51 /**
52 * Returns whether the project files exists.
53 * @return True, if so
54 */
55 inline bool fileExists() const;
56
57 protected:
58
59 /// Parsed project files.
61
62 /// State determining whether the project file exists.
63 bool fileExists_ = false;
64};
65
67{
68 return filenames_;
69}
70
71inline bool ProjectFile::fileExists() const
72{
73 return fileExists_;
74}
75
76}
77
78}
79
80#endif // META_OCEAN_IO_FILE_CONFIG_H
This class implements an application or module configuration toolkit using files as input or output.
Definition FileConfig.h:29
This class implements an project file loader.
Definition ProjectFile.h:24
ProjectFile(const std::string &filename)
Creates a new project file object by a given configuration file.
ProjectFile()=default
Creates a new project file object.
Filenames filenames_
Parsed project files.
Definition ProjectFile.h:60
bool fileExists_
State determining whether the project file exists.
Definition ProjectFile.h:63
std::vector< std::string > Filenames
Definition of a vector holding a filenames.
Definition ProjectFile.h:30
bool fileExists() const
Returns whether the project files exists.
Definition ProjectFile.h:71
const Filenames & filenames() const
Returns the file types registered inside the project file.
Definition ProjectFile.h:66
The namespace covering the entire Ocean framework.
Definition Accessor.h:15