-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFile.h
More file actions
26 lines (22 loc) · 719 Bytes
/
File.h
File metadata and controls
26 lines (22 loc) · 719 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once
#include "SystemObject.h"
#include "User.h"
namespace fs
{
class File final : public SystemObject
{
private:
std::string m_content;
public:
File(const User* user, const std::string& name, const std::string& parentPath);
explicit File(std::istringstream& ifs);
void setContent(const std::string& content);
void writeToFile(const std::string& content) const;
void appendToFile(const std::string& content) const;
void printFile() const;
void cascadeDelete() override;
[[nodiscard]] const std::string& getContent() const;
[[nodiscard]] size_t getSize() const override;
static std::string& adaptParentPath(std::string& parentPath);
};
} // namespace fs