Skip to content

Commit 550e30d

Browse files
committed
Converted header guards to #prama once
1 parent 6beec43 commit 550e30d

File tree

8 files changed

+8
-30
lines changed

8 files changed

+8
-30
lines changed

include/cipherist.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef COMPRESSOR_CIPHERER_H
2-
#define COMPRESSOR_CIPHERER_H
1+
#pragma once
32

43
#include <cstdint>
54
#include <string>
@@ -9,5 +8,3 @@ class Cipherist {
98
static void encrypt(uint8_t key, std::string &text);
109
static void decrypt(uint8_t key, std::string &text);
1110
};
12-
13-
#endif // COMPRESSOR_CIPHERER_H

include/command_handler.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef COMPRESSOR_CMD_HANDLER_H
2-
#define COMPRESSOR_CMD_HANDLER_H
1+
#pragma once
32

43
#include <string>
54

@@ -9,5 +8,3 @@ class CommandHandler {
98
const std::string &output_filename,
109
const std::string &command, uint8_t k_num);
1110
};
12-
13-
#endif // COMPRESSOR_CMD_HANDLER_H

include/file_handler.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef COMPRESSOR_FILE_HANDLER_H
2-
#define COMPRESSOR_FILE_HANDLER_H
1+
#pragma once
32

43
#include <string>
54
#include <vector>
@@ -11,5 +10,3 @@ class FileIO {
1110
static void write(const std::string &filename,
1211
const std::vector<std::string> &content);
1312
};
14-
15-
#endif // COMPRESSOR_FILE_HANDLER_H

include/huffman_codec.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
#ifndef COMPRESSOR_HUFFMAN_CODEC_H
2-
#define COMPRESSOR_HUFFMAN_CODEC_H
1+
#pragma once
32

43
#include <map>
54
#include <string>
65
#include <utility>
76

8-
#include "huffman_tree.h"
9-
107
class HuffmanCodec {
118
/** This is used to encode characters that did not exist in the input file.
129
* The value can be anything other than 0 and 1 as we work with string
@@ -24,5 +21,3 @@ class HuffmanCodec {
2421
static int getHuffmanCodes(std::map<std::string, char> &code_to_char_map,
2522
const std::string &keys);
2623
};
27-
28-
#endif // COMPRESSOR_HUFFMAN_CODEC_H

include/huffman_tree.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef COMPRESSOR_TREE_H
2-
#define COMPRESSOR_TREE_H
1+
#pragma once
32

43
#include <cstdint>
54
#include <string>
@@ -25,5 +24,3 @@ class HuffmanTree {
2524
static void dfs(const Node *node, std::vector<std::string> &codes,
2625
const std::string &code);
2726
};
28-
29-
#endif // COMPRESSOR_TREE_H

include/lz77_codec.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef COMPRESSOR_LZ77CODEC_H
2-
#define COMPRESSOR_LZ77CODEC_H
1+
#pragma once
32

43
#include <string>
54

@@ -19,5 +18,3 @@ class LZ77Codec {
1918
int length;
2019
};
2120
};
22-
23-
#endif // COMPRESSOR_LZ77CODEC_H

include/node.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef COMPRESSOR_NODE_H
2-
#define COMPRESSOR_NODE_H
1+
#pragma once
32

43
class Node {
54
public:
@@ -29,5 +28,3 @@ struct NodeComparator {
2928
return rhs->getFreq() <= lhs->getFreq();
3029
}
3130
};
32-
33-
#endif // COMPRESSOR_NODE_H

src/operations/huffman_codec.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <sstream>
44

55
#include "huffman_codec.h"
6+
#include "huffman_tree.h"
67

78
/** Num of bits in a byte. */
89
constexpr int BYTE_LEN = 8;

0 commit comments

Comments
 (0)