This repository was archived by the owner on Apr 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfs.cpp
More file actions
106 lines (98 loc) · 1.87 KB
/
Copy pathfs.cpp
File metadata and controls
106 lines (98 loc) · 1.87 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/**
* @file fs.cpp
* @brief The implementation for the FileSystem class.
*
* @author Evan Elias Young
* @date 2019-03-30
* @date 2020-02-28
* @copyright Copyright 2019-2020 Evan Elias Young. All rights reserved.
*/
#include "pch.h"
#include "fs.h"
#include "utils.h"
#pragma region "Contructors"
/**
* @brief Construct a new FileSystem object
*/
FileSystem::FileSystem()
{
fs = "";
type = "";
size = 0;
used = 0;
mount = "";
}
/**
* @brief Construct a new FileSystem object
*
* @param f The filesystem
* @param tp The type
* @param sz The total storage
* @param us The used storage
* @param mnt The mount-point
*/
FileSystem::FileSystem(std::string f, std::string tp, std::uint64_t sz, std::uint64_t us, std::string mnt)
{
fs = f;
type = tp;
size = sz;
used = us;
mount = mnt;
}
/**
* @brief Construct a new FileSystem object from another FileSystem object
*
* @param o The FileSystem object to copy from
*/
FileSystem::FileSystem(const FileSystem &o)
{
fs = o.fs;
type = o.type;
size = o.size;
used = o.used;
mount = o.mount;
}
#pragma endregion "Contructors"
#pragma region "Operators"
/**
* @brief Reserves memory for a new fs object
*
* @param size The amount of memory to allocate
* @return void* A pointer to the allocated memory
*/
void *FileSystem::operator new(std::size_t size)
{
void *o = ::new (FileSystem);
return o;
}
/**
* @brief Sets equal two fs objects
*
* @param o The fs object to copy from
*/
void FileSystem::operator=(const FileSystem &o)
{
if (&o == this)
{
return;
}
fs = o.fs;
type = o.type;
size = o.size;
used = o.used;
mount = o.mount;
}
/**
* @brief Sets equal two fs objects
*
* @param o The fs object to copy from
*/
void FileSystem::operator=(FileSystem *o)
{
fs = o->fs;
type = o->type;
size = o->size;
used = o->used;
mount = o->mount;
}
#pragma endregion "Operators"