Skip to content

Commit d0f146e

Browse files
doc(filesystem): just a few docs for filesystem stuff
1 parent bbb6231 commit d0f146e

File tree

4 files changed

+31
-6
lines changed

4 files changed

+31
-6
lines changed

include/Filesystem/Directory.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,20 @@
1717

1818
namespace lce::fs {
1919

20+
/** Contains other `FSObject`s inside it.
21+
*
22+
* Can be used as the root of a Filesystem
23+
*
24+
* @see File
25+
* @see Filesystem
26+
* @see FSObject
27+
*/
2028
class LIBLCE_API Directory : public FSObject {
2129
public:
2230
Directory(Directory &&) = default;
2331
Directory &operator=(Directory &&) = default;
2432

25-
/**
33+
/** Creates a Directory
2634
*
2735
* @param name The name of the directory (if root, specify
2836
* Filesystem::ROOT)
@@ -230,6 +238,7 @@ namespace lce::fs {
230238
};
231239

232240
private:
241+
/** Child objects inside the Directory */
233242
std::unordered_map<std::wstring, std::unique_ptr<FSObject>> children;
234243
};
235244

include/Filesystem/FSObject.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
namespace lce::fs {
1414
class Directory;
1515

16+
/** A base Filesystem Object
17+
*
18+
* @see File
19+
* @see Directory
20+
*/
1621
class LIBLCE_API FSObject {
1722
friend class Filesystem;
1823
friend class Directory;
@@ -110,9 +115,7 @@ namespace lce::fs {
110115
/** @returns The object's full path */
111116
[[nodiscard]] std::wstring getPath() const;
112117

113-
[[nodiscard]] Directory *getParent() const {
114-
return this->parent;
115-
};
118+
[[nodiscard]] Directory *getParent() const { return this->parent; };
116119

117120
private:
118121
std::wstring name;

include/Filesystem/File.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
#include <Filesystem/FSObject.h>
1616

1717
namespace lce::fs {
18+
/** Holds data
19+
*
20+
* @see Directory
21+
* @see FSObject
22+
*/
1823
class LIBLCE_API File : public FSObject {
1924
protected:
2025
friend class Directory;
@@ -74,10 +79,12 @@ namespace lce::fs {
7479
/// Writes the file to the physical filesystem into the given path
7580
void writeOut(const std::filesystem::path &path) const;
7681

77-
/// Writes the file to the physical filesystem into the given path (using end of path as filename)
82+
/// Writes the file to the physical filesystem into the given path
83+
/// (using end of path as filename)
7884
void writeOutFullPath(const std::wstring &path) const;
7985

80-
/// Writes the file to the physical filesystem into the given path (using end of path as filename)
86+
/// Writes the file to the physical filesystem into the given path
87+
/// (using end of path as filename)
8188
void writeOutFullPath(const std::filesystem::path &path) const;
8289

8390
/// Writes the file to the physical filesystem to the current dir

include/Filesystem/Filesystem.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@
1515

1616
namespace lce::fs {
1717

18+
/** Contains a root folder and helper methods for traversing the filesystem
19+
*
20+
* Can be extended to make custom filesystem types
21+
*/
1822
class LIBLCE_API Filesystem {
1923
public:
2024
// const const constexpr const const const
25+
/** Root directory path */
2126
static constexpr const wchar_t *const ROOT = L"/";
2227

2328
// hope I did this right
@@ -69,6 +74,7 @@ namespace lce::fs {
6974
virtual ~Filesystem() = default;
7075

7176
private:
77+
/** The root directory of the filesystem */
7278
std::unique_ptr<Directory> root;
7379
};
7480
} // namespace lce::fs

0 commit comments

Comments
 (0)