-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode_size_result.h
More file actions
34 lines (26 loc) · 916 Bytes
/
code_size_result.h
File metadata and controls
34 lines (26 loc) · 916 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
27
28
29
30
31
32
33
34
#pragma once
class CodeSizeResult
{
public:
CodeSizeResult() = default;
CodeSizeResult(uint32_t sizeInBytes, uint32_t totalFiles, uint32_t codeLines)
: _nSizeInBytes(sizeInBytes), _nTotalFiles(totalFiles), _codeLines(codeLines) {}
CodeSizeResult operator+(const CodeSizeResult& other) const {
return CodeSizeResult(
this->_nSizeInBytes + other._nSizeInBytes,
this->_nTotalFiles + other._nTotalFiles,
this->_codeLines + other._codeLines
);
}
CodeSizeResult& operator+=(const CodeSizeResult& other) {
this->_nSizeInBytes += other._nSizeInBytes;
this->_nTotalFiles += other._nTotalFiles;
this->_codeLines += other._codeLines;
return *this;
}
void print(const string &codeTypeName) const;
private:
uint32_t _nSizeInBytes = 0;
uint32_t _nTotalFiles = 0;
uint32_t _codeLines = 0;
};