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