Everywhere: Switch to #pragma once, add missing copyright headers
This commit is contained in:
+1
-4
@@ -4,8 +4,7 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CONFIG_H
|
#pragma once
|
||||||
#define CONFIG_H
|
|
||||||
|
|
||||||
#include <cstddef> // size_t
|
#include <cstddef> // size_t
|
||||||
#include <filesystem> // path
|
#include <filesystem> // path
|
||||||
@@ -67,5 +66,3 @@ private:
|
|||||||
|
|
||||||
void toJson(Util::Json& object, const Settings& settings);
|
void toJson(Util::Json& object, const Settings& settings);
|
||||||
void fromJson(const Util::Json& object, Settings& settings);
|
void fromJson(const Util::Json& object, Settings& settings);
|
||||||
|
|
||||||
#endif // CONFIG_H
|
|
||||||
|
|||||||
+1
-4
@@ -4,8 +4,7 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef DOTFILE_H
|
#pragma once
|
||||||
#define DOTFILE_H
|
|
||||||
|
|
||||||
#include <cstddef> // size_t
|
#include <cstddef> // size_t
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
@@ -43,5 +42,3 @@ private:
|
|||||||
|
|
||||||
void forEachDotfile(const std::vector<std::string>& targets, const std::function<void(const std::filesystem::directory_entry&, size_t)>& callback);
|
void forEachDotfile(const std::vector<std::string>& targets, const std::function<void(const std::filesystem::directory_entry&, size_t)>& callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DOTFILE_H
|
|
||||||
|
|||||||
+1
-4
@@ -4,8 +4,7 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MACHINE_H
|
#pragma once
|
||||||
#define MACHINE_H
|
|
||||||
|
|
||||||
#include <cstdint> // uint32_t
|
#include <cstdint> // uint32_t
|
||||||
#include <pwd.h> // passwd
|
#include <pwd.h> // passwd
|
||||||
@@ -36,5 +35,3 @@ private:
|
|||||||
std::string m_hostname;
|
std::string m_hostname;
|
||||||
passwd* m_passwd { nullptr };
|
passwd* m_passwd { nullptr };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MACHINE_H
|
|
||||||
|
|||||||
+1
-4
@@ -4,8 +4,7 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef PACKAGE_H
|
#pragma once
|
||||||
#define PACKAGE_H
|
|
||||||
|
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -45,5 +44,3 @@ private:
|
|||||||
|
|
||||||
Distro m_distro { Distro::Unsupported };
|
Distro m_distro { Distro::Unsupported };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PACKAGE_H
|
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
#ifndef ARG_PARSER_H
|
/*
|
||||||
#define ARG_PARSER_H
|
* Copyright (C) 2022 Riyyi
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include <cstddef> // size_t
|
#include <cstddef> // size_t
|
||||||
#include <functional> // function
|
#include <functional> // function
|
||||||
@@ -112,5 +117,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Util
|
} // namespace Util
|
||||||
|
|
||||||
#endif // ARG_PARSER_H
|
|
||||||
|
|||||||
+1
-5
@@ -4,8 +4,7 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef FILE_H
|
#pragma once
|
||||||
#define FILE_H
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@@ -33,6 +32,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Util
|
} // namespace Util
|
||||||
|
|
||||||
|
|
||||||
#endif // FILE_H
|
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef UTIL_FORMAT_BUILDER_H
|
#pragma once
|
||||||
#define UTIL_FORMAT_BUILDER_H
|
|
||||||
|
|
||||||
#include <cstddef> // size_t
|
#include <cstddef> // size_t
|
||||||
#include <cstdint> // int32_t, uint32_t, int64_t
|
#include <cstdint> // int32_t, uint32_t, int64_t
|
||||||
@@ -46,5 +45,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Util::Format
|
} // namespace Util::Format
|
||||||
|
|
||||||
#endif // UTIL_FORMAT_BUILDER_H
|
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef UTIL_FORMAT_FORMAT_H
|
#pragma once
|
||||||
#define UTIL_FORMAT_FORMAT_H
|
|
||||||
|
|
||||||
#include <cstddef> // size_t
|
#include <cstddef> // size_t
|
||||||
#include <sstream> // stringstream
|
#include <sstream> // stringstream
|
||||||
@@ -194,5 +193,3 @@ using Util::Format::str;
|
|||||||
using Util::Format::strln;
|
using Util::Format::strln;
|
||||||
|
|
||||||
using FormatBuilder = Util::Format::Builder;
|
using FormatBuilder = Util::Format::Builder;
|
||||||
|
|
||||||
#endif // UTIL_FORMAT_FORMAT_H
|
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef UTIL_FORMAT_PARSER_H
|
#pragma once
|
||||||
#define UTIL_FORMAT_PARSER_H
|
|
||||||
|
|
||||||
#include <cstddef> // size_t
|
#include <cstddef> // size_t
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
@@ -33,5 +32,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Util::Format
|
} // namespace Util::Format
|
||||||
|
|
||||||
#endif // UTIL_FORMAT_PARSER_H
|
|
||||||
|
|||||||
@@ -4,11 +4,10 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef UTIL_TO_FORMAT_H
|
#pragma once
|
||||||
#define UTIL_TO_FORMAT_H
|
|
||||||
|
|
||||||
#include <cstddef> // nullptr_t
|
#include <cstddef> // nullptr_t, size_t
|
||||||
#include <cstdint> // int64_t
|
#include <cstdint> // int32_t, uint32_t, int64_t
|
||||||
#include <cstring> // strlen
|
#include <cstring> // strlen
|
||||||
#include <iterator> // next
|
#include <iterator> // next
|
||||||
#include <map>
|
#include <map>
|
||||||
@@ -164,5 +163,3 @@ constexpr const auto& format = Util::Detail::staticConst<Detail::formatFunction>
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
} // namespace Util::Format
|
} // namespace Util::Format
|
||||||
|
|
||||||
#endif // UTIL_TO_FORMAT_H
|
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef UTIL_GENERIC_LEXER_H
|
#pragma once
|
||||||
#define UTIL_GENERIC_LEXER_H
|
|
||||||
|
|
||||||
#include <cassert> // assert
|
#include <cassert> // assert
|
||||||
#include <cstddef> // size_t
|
#include <cstddef> // size_t
|
||||||
@@ -41,5 +40,3 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Util
|
} // namespace Util
|
||||||
|
|
||||||
#endif // UTIL_GENERIC_LEXER_H
|
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef UTIL_JSON_ARRAY_H
|
#pragma once
|
||||||
#define UTIL_JSON_ARRAY_H
|
|
||||||
|
|
||||||
#include <utility> // move
|
#include <utility> // move
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -55,5 +54,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Util::JSON
|
} // namespace Util::JSON
|
||||||
|
|
||||||
#endif // UTIL_JSON_ARRAY_H
|
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef UTIL_JSON_FROM_JSON_H
|
#pragma once
|
||||||
#define UTIL_JSON_FROM_JSON_H
|
|
||||||
|
|
||||||
#include <algorithm> // transform
|
#include <algorithm> // transform
|
||||||
#include <cassert> // assert
|
#include <cassert> // assert
|
||||||
@@ -118,8 +117,6 @@ constexpr const auto& fromJson = Util::Detail::staticConst<Detail::fromJsonFunct
|
|||||||
|
|
||||||
} // namespace Util::JSON
|
} // namespace Util::JSON
|
||||||
|
|
||||||
#endif // UTIL_JSON_FROM_JSON_H
|
|
||||||
|
|
||||||
// Customization Points
|
// Customization Points
|
||||||
// https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4381.html
|
// https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4381.html
|
||||||
|
|
||||||
|
|||||||
+1
-4
@@ -4,8 +4,7 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef UTIL_JSON_JOB_H
|
#pragma once
|
||||||
#define UTIL_JSON_JOB_H
|
|
||||||
|
|
||||||
#include <cstddef> // size_t
|
#include <cstddef> // size_t
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
@@ -49,5 +48,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Util::JSON
|
} // namespace Util::JSON
|
||||||
|
|
||||||
#endif // UTIL_JSON_JOB_H
|
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef UTIL_JSON_JSON_H
|
#pragma once
|
||||||
#define UTIL_JSON_JSON_H
|
|
||||||
|
|
||||||
#include "util/json/value.h"
|
#include "util/json/value.h"
|
||||||
|
|
||||||
@@ -14,5 +13,3 @@ namespace Util {
|
|||||||
using Json = Util::JSON::Value;
|
using Json = Util::JSON::Value;
|
||||||
|
|
||||||
} // namespace Util
|
} // namespace Util
|
||||||
|
|
||||||
#endif // UTIL_JSON_JSON_H
|
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef UTIL_JSON_LEXER_H
|
#pragma once
|
||||||
#define UTIL_JSON_LEXER_H
|
|
||||||
|
|
||||||
// The JavaScript Object Notation (JSON) Data Interchange Format
|
// The JavaScript Object Notation (JSON) Data Interchange Format
|
||||||
// https://www.rfc-editor.org/rfc/pdfrfc/rfc8259.txt.pdf
|
// https://www.rfc-editor.org/rfc/pdfrfc/rfc8259.txt.pdf
|
||||||
@@ -63,5 +62,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Util::JSON
|
} // namespace Util::JSON
|
||||||
|
|
||||||
#endif // UTIL_JSON_LEXER_H
|
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef UTIL_JSON_OBJECT_H
|
#pragma once
|
||||||
#define UTIL_JSON_OBJECT_H
|
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -51,5 +50,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Util::JSON
|
} // namespace Util::JSON
|
||||||
|
|
||||||
#endif // UTIL_JSON_OBJECT_H
|
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef UTIL_JSON_PARSER_H
|
#pragma once
|
||||||
#define UTIL_JSON_PARSER_H
|
|
||||||
|
|
||||||
#include <cstddef> // size_t
|
#include <cstddef> // size_t
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -44,5 +43,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Util::JSON
|
} // namespace Util::JSON
|
||||||
|
|
||||||
#endif // UTIL_JSON_PARSER_H
|
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef UTIL_JSON_SERIALIZER_H
|
#pragma once
|
||||||
#define UTIL_JSON_SERIALIZER_H
|
|
||||||
|
|
||||||
#include <cstdint> // uint32_t
|
#include <cstdint> // uint32_t
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -33,5 +32,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Util::JSON
|
} // namespace Util::JSON
|
||||||
|
|
||||||
#endif // UTIL_JSON_SERIALIZER_H
|
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef UTIL_JSON_TO_JSON_H
|
#pragma once
|
||||||
#define UTIL_JSON_TO_JSON_H
|
|
||||||
|
|
||||||
#include <cassert> // assert
|
#include <cassert> // assert
|
||||||
#include <cstddef> // nullptr_t
|
#include <cstddef> // nullptr_t
|
||||||
@@ -138,8 +137,6 @@ constexpr const auto& toJson = Util::Detail::staticConst<Detail::toJsonFunction>
|
|||||||
|
|
||||||
} // namespace Util::JSON
|
} // namespace Util::JSON
|
||||||
|
|
||||||
#endif // UTIL_JSON_TO_JSON_H
|
|
||||||
|
|
||||||
// Customization Points
|
// Customization Points
|
||||||
// https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4381.html
|
// https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4381.html
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef UTIL_JSON_VALUE_H
|
#pragma once
|
||||||
#define UTIL_JSON_VALUE_H
|
|
||||||
|
|
||||||
#include <cstddef> // nullptr_t, size_t
|
#include <cstddef> // nullptr_t, size_t
|
||||||
#include <cstdint> // uint32_t
|
#include <cstdint> // uint32_t
|
||||||
@@ -148,5 +147,3 @@ inline Json::Value operator"" _json(const char* input, size_t length)
|
|||||||
{
|
{
|
||||||
return Json::Value::parse(std::string(input, length));
|
return Json::Value::parse(std::string(input, length));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // UTIL_JSON_VALUE_H
|
|
||||||
|
|||||||
+1
-4
@@ -4,8 +4,7 @@
|
|||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef META_ODR_H
|
#pragma once
|
||||||
#define META_ODR_H
|
|
||||||
|
|
||||||
namespace Util {
|
namespace Util {
|
||||||
|
|
||||||
@@ -19,5 +18,3 @@ constexpr T staticConst {};
|
|||||||
} // namespace Detail
|
} // namespace Detail
|
||||||
|
|
||||||
} // namespace Util
|
} // namespace Util
|
||||||
|
|
||||||
#endif // META_ODR_H
|
|
||||||
|
|||||||
+7
-4
@@ -1,5 +1,10 @@
|
|||||||
#ifndef SHELL_H
|
/*
|
||||||
#define SHELL_H
|
* Copyright (C) 2022 Riyyi
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
@@ -26,5 +31,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Util
|
} // namespace Util
|
||||||
|
|
||||||
#endif // SHELL_H
|
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
#ifndef SINGLETON_H
|
/*
|
||||||
#define SINGLETON_H
|
* Copyright (C) 2022 Riyyi
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
@@ -46,5 +51,3 @@ template<typename T>
|
|||||||
T* Singleton<T>::s_instance = nullptr;
|
T* Singleton<T>::s_instance = nullptr;
|
||||||
|
|
||||||
} // namespace Util
|
} // namespace Util
|
||||||
|
|
||||||
#endif // SINGLETON_H
|
|
||||||
|
|||||||
+7
-4
@@ -1,5 +1,10 @@
|
|||||||
#ifndef SYSTEM_H
|
/*
|
||||||
#define SYSTEM_H
|
* Copyright (C) 2022 Riyyi
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include <cstdint> // int32_t, uint32_t
|
#include <cstdint> // int32_t, uint32_t
|
||||||
#include <functional> // function
|
#include <functional> // function
|
||||||
@@ -61,5 +66,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Util
|
} // namespace Util
|
||||||
|
|
||||||
#endif // SYSTEM_H
|
|
||||||
|
|||||||
+7
-4
@@ -1,5 +1,10 @@
|
|||||||
#ifndef TIMER_H
|
/*
|
||||||
#define TIMER_H
|
* Copyright (C) 2022 Riyyi
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include <chrono> // high_resolution_clock
|
#include <chrono> // high_resolution_clock
|
||||||
#include <cstdint> // uint64_t
|
#include <cstdint> // uint64_t
|
||||||
@@ -44,5 +49,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Util
|
} // namespace Util
|
||||||
|
|
||||||
#endif // TIMER_H
|
|
||||||
|
|||||||
Reference in New Issue
Block a user