AGX Dynamics  2.37.3.2
FilePathContainer.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGXIO_FILEPATHCONTAINER_H
18 #define AGXIO_FILEPATHCONTAINER_H
19 
20 #ifdef _MSC_VER
21 # pragma warning(push)
22 # pragma warning(disable:4786) // Disable warnings about long names
23 #endif
24 
25 #include <agxIO/FileSystem.h>
26 #include <agx/agxCore_export.h>
27 #include <agx/List.h>
28 
29 namespace agxIO
30 {
33  {
34 
35  public:
37 
38  public:
43 
47  FilePathContainer(const agx::String& env);
48 
51 
55  void clear();
56 
63  void setFilePathList(const agx::String& paths,
64  bool clearPrevious = true,
66 
70  bool setFromEnvironmentVariable(const agx::String& env, bool clearPrevious = true );
71 
75  void setFilePath(const agx::String& path);
76 
81  void addFilePath(const agx::String& path);
82 
87  void removeFilePath(const agx::String& path);
88 
94  void pushbackPath(const agx::String& path);
95 
100  void pushfrontPath(const agx::String& path);
101 
105  PathList& getFilePathList();
106 
110  const PathList& getFilePathList() const;
111 
117  agx::String find(const agx::String& filename) const;
118 
119  private:
120 
122  PathList m_path_list;
123 
124 
126  void convertStringToList(const agx::String& str, PathList& lst, const agx::String& delimiter);
127 
128  void removeDuplicates();
129 
131  agx::String m_delimiter;
132 
133  };
134 
135 }
136 
137 #ifdef _MSC_VER
138 # pragma warning(pop)
139 #endif
140 #endif // AGXIO_FILEPATHCONTAINER_H
AGXTERRAIN_EXPORT void clear()
The agxIO namespace contains classes for reading, writing and finding files.
Definition: Material.h:41
static AGXCORE_EXPORT const char *const PATH_DELIMITER
Separator between paths in a list of paths, on unix: :, on windows ;.
Definition: FileSystem.h:47
agx::List< agx::String > PathList
class for locating files
#define AGXCORE_EXPORT