General: Include headers that are necessary

Removes unused headers and ensures that all necessary headers are
included. In particular, this removes quite a few <iostream> includes,
which removes quite a few static constructors.
This commit is contained in:
Lioncash 2019-08-26 07:06:18 -04:00
parent d1d1850cb7
commit 9c50a60c2b
32 changed files with 125 additions and 88 deletions

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "LZBase.hpp" #include "LZ77/LZBase.hpp"
class LZType10 : public LZBase { class LZType10 : public LZBase {
public: public:

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "LZBase.hpp" #include "LZ77/LZBase.hpp"
class LZType11 : public LZBase { class LZType11 : public LZBase {
public: public:

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "athena/Global.hpp" #include "athena/Types.hpp"
namespace athena::checksums { namespace athena::checksums {
atUint64 crc64(const atUint8* data, atUint64 length, atUint64 seed = 0xFFFFFFFFFFFFFFFF, atUint64 crc64(const atUint8* data, atUint64 length, atUint64 seed = 0xFFFFFFFFFFFFFFFF,

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "athena/Global.hpp" #include "athena/Types.hpp"
namespace athena::io::Compression { namespace athena::io::Compression {
// Zlib compression // Zlib compression

View File

@ -6,12 +6,16 @@
* Any changes to the types or namespacing must be reflected in 'atdna/main.cpp' * Any changes to the types or namespacing must be reflected in 'atdna/main.cpp'
*/ */
#include "Global.hpp"
#include "IStreamReader.hpp"
#include "IStreamWriter.hpp"
#include "DNAOp.hpp"
#include <vector>
#include <memory> #include <memory>
#include <string>
#include <vector>
#include <sys/types.h>
#include "athena/DNAOp.hpp"
#include "athena/Global.hpp"
#include "athena/IStreamReader.hpp"
#include "athena/IStreamWriter.hpp"
namespace athena::io { namespace athena::io {

View File

@ -1,11 +1,16 @@
#pragma once #pragma once
#include "IStreamReader.hpp" #include <cstddef>
#include "IStreamWriter.hpp" #include <cstdint>
#include "YAMLDocReader.hpp" #include <string>
#include "YAMLDocWriter.hpp"
#include "ChecksumsLiterals.hpp"
#include <type_traits> #include <type_traits>
#include <vector>
#include "athena/ChecksumsLiterals.hpp"
#include "athena/IStreamReader.hpp"
#include "athena/IStreamWriter.hpp"
#include "athena/YAMLDocReader.hpp"
#include "athena/YAMLDocWriter.hpp"
namespace athena::io { namespace athena::io {

View File

@ -1,10 +1,13 @@
#pragma once #pragma once
#include "YAMLDocReader.hpp" #include <string>
#include "YAMLDocWriter.hpp" #include <type_traits>
#include "DNA.hpp"
#include "FileReader.hpp" #include "athena/DNA.hpp"
#include "FileWriter.hpp" #include "athena/FileReader.hpp"
#include "athena/FileWriter.hpp"
#include "athena/YAMLDocReader.hpp"
#include "athena/YAMLDocWriter.hpp"
namespace athena::io { namespace athena::io {

View File

@ -1,11 +1,9 @@
#pragma once #pragma once
#include "athena/FileInfo.hpp" #include <string>
#include <cstdio>
#include <vector>
#if _WIN32 #if _WIN32
typedef int mode_t; using mode_t = int;
#endif #endif
namespace athena { namespace athena {
@ -19,8 +17,6 @@ public:
bool isDir() const; bool isDir() const;
static bool isDir(std::string_view dir) { return Dir(dir).isDir(); } static bool isDir(std::string_view dir) { return Dir(dir).isDir(); }
std::vector<FileInfo> files() const;
bool cd(std::string_view path); bool cd(std::string_view path);
bool rm(std::string_view path); bool rm(std::string_view path);
bool touch(); bool touch();

View File

@ -2,7 +2,7 @@
#include <string> #include <string>
#include "athena/Global.hpp" #include "athena/Types.hpp"
namespace athena { namespace athena {
class FileInfo { class FileInfo {

View File

@ -9,9 +9,11 @@
#include <cstdio> #include <cstdio>
#endif #endif
#include <string>
#include <memory> #include <memory>
#include <string>
#include "athena/IStreamReader.hpp" #include "athena/IStreamReader.hpp"
#include "athena/Types.hpp"
namespace athena::io { namespace athena::io {
class FileReader : public IStreamReader { class FileReader : public IStreamReader {

View File

@ -8,7 +8,9 @@
#else #else
#include <cstdio> #include <cstdio>
#endif #endif
#include "athena/IStreamWriter.hpp" #include "athena/IStreamWriter.hpp"
#include "athena/Types.hpp"
namespace athena::io { namespace athena::io {
class FileWriter : public IStreamWriter { class FileWriter : public IStreamWriter {

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "Global.hpp" #include "athena/Global.hpp"
namespace athena::io { namespace athena::io {
std::ostream& operator<<(std::ostream& os, Endian& endian); std::ostream& operator<<(std::ostream& os, Endian& endian);

View File

@ -1,10 +1,12 @@
#pragma once #pragma once
#include <memory>
#include <functional> #include <functional>
#include "utf8proc.h" #include <memory>
#include "Utility.hpp" #include <type_traits>
#include "IStream.hpp" #include <vector>
#include "athena/IStream.hpp"
#include "athena/Utility.hpp"
namespace athena::io { namespace athena::io {
/** @brief The IStreamReader class defines a basic API for reading from streams, Implementors are provided with one pure /** @brief The IStreamReader class defines a basic API for reading from streams, Implementors are provided with one pure

View File

@ -1,11 +1,14 @@
#pragma once #pragma once
#include "utf8proc.h" #include <string>
#include "IStream.hpp" #include <type_traits>
#include "Utility.hpp"
#include <memory>
#include <vector> #include <vector>
#include "utf8proc.h"
#include "athena/IStream.hpp"
#include "athena/Utility.hpp"
namespace athena::io { namespace athena::io {
class IStreamWriter : public IStream { class IStreamWriter : public IStream {
public: public:

View File

@ -1,8 +1,8 @@
#pragma once #pragma once
#include <string>
#include <memory> #include <memory>
#include <functional> #include <string>
#include "athena/IStreamWriter.hpp" #include "athena/IStreamWriter.hpp"
namespace athena::io { namespace athena::io {

View File

@ -1,15 +1,12 @@
#pragma once #pragma once
#include <sys/types.h> #include <cstddef>
#include <fcntl.h> #include <cstdint>
#include <string> #include <string>
#include <memory.h>
#include "Global.hpp"
#ifdef _WIN32 #ifdef _WIN32
#include <BaseTsd.h> #include <BaseTsd.h>
typedef UINT_PTR SOCKET; using SOCKET = UINT_PTR;
#endif #endif
struct sockaddr_in; struct sockaddr_in;

View File

@ -1,11 +1,11 @@
#ifndef __UTILITY_H__ #ifndef __UTILITY_H__
#define __UTILITY_H__ #define __UTILITY_H__
#include <cstring>
#include <string> #include <string>
#include <string_view> #include <string_view>
#include <vector> #include <vector>
#include <cstdarg>
#include <cstring>
#include "athena/Global.hpp" #include "athena/Global.hpp"
#include "athena/Types.hpp" #include "athena/Types.hpp"

View File

@ -1,10 +1,10 @@
#pragma once #pragma once
#include <string> #include <cstdint>
#include <memory>
#include <functional>
#include <vector> #include <vector>
#include "athena/IStreamWriter.hpp" #include "athena/IStreamWriter.hpp"
#include "athena/Types.hpp"
namespace athena::io { namespace athena::io {

View File

@ -4,13 +4,13 @@
#pragma once #pragma once
#include <cstring>
#include <yaml.h>
#include <utf8proc.h>
#include <vector>
#include <memory> #include <memory>
#include <functional> #include <string>
#include "Global.hpp" #include <vector>
#include <yaml.h>
#include "athena/Types.hpp"
namespace athena::io { namespace athena::io {
class IStreamReader; class IStreamReader;

View File

@ -1,6 +1,14 @@
#pragma once #pragma once
#include "YAMLCommon.hpp" #include <cstddef>
#include <functional>
#include <memory>
#include <string>
#include <type_traits>
#include <vector>
#include "athena/Types.hpp"
#include "athena/YAMLCommon.hpp"
namespace athena::io { namespace athena::io {

View File

@ -1,6 +1,13 @@
#pragma once #pragma once
#include "YAMLCommon.hpp" #include <cstddef>
#include <memory>
#include <string>
#include <type_traits>
#include <vector>
#include "athena/Types.hpp"
#include "athena/YAMLCommon.hpp"
namespace athena::io { namespace athena::io {

View File

@ -1,7 +1,4 @@
#include "athena/Checksums.hpp" #include "athena/Checksums.hpp"
#include "athena/FileReader.hpp"
#include <iostream>
#include <iomanip>
namespace athena::checksums { namespace athena::checksums {
atUint64 crc64(const atUint8* data, atUint64 length, atUint64 seed, atUint64 final) { atUint64 crc64(const atUint8* data, atUint64 length, atUint64 seed, atUint64 final) {

View File

@ -1,8 +1,9 @@
#include "athena/Compression.hpp" #include "athena/Compression.hpp"
#if AT_LZOKAY #if AT_LZOKAY
#include <lzokay.hpp> #include <lzokay.hpp>
#endif #endif
#include <iostream>
#include <zlib.h> #include <zlib.h>
#include "LZ77/LZType10.hpp" #include "LZ77/LZType10.hpp"
#include "LZ77/LZType11.hpp" #include "LZ77/LZType11.hpp"

View File

@ -1,5 +1,10 @@
#include "athena/DNAYaml.hpp" #include "athena/DNAYaml.hpp"
#include <cctype>
#include <cstdlib>
#include "athena/YAMLCommon.hpp"
namespace athena::io { namespace athena::io {
template <> template <>

View File

@ -1,10 +1,14 @@
#include "athena/Dir.hpp" #include "athena/Dir.hpp"
#include <sys/stat.h>
#include <climits> #include <climits>
#include <cstdlib> #include <cstdlib>
#include <ctime> #include <ctime>
#include <sys/stat.h>
#define __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS
#include <cinttypes> #include <cinttypes>
#include "athena/FileInfo.hpp"
#include "athena/Utility.hpp" #include "athena/Utility.hpp"
#ifndef _WIN32 #ifndef _WIN32

View File

@ -1,11 +1,13 @@
#include "athena/FileInfo.hpp" #include "athena/FileInfo.hpp"
#include "athena/Utility.hpp"
#include "athena/FileWriter.hpp" #include <climits>
#include "athena/FileReader.hpp"
#include <ctime>
#include <cstdio> #include <cstdio>
#include <limits.h>
#include <cstdlib> #include <cstdlib>
#include <ctime>
#include "athena/FileReader.hpp"
#include "athena/FileWriter.hpp"
#include "athena/Utility.hpp"
#ifndef _WIN32 #ifndef _WIN32
#include <sys/time.h> #include <sys/time.h>

View File

@ -1,5 +1,7 @@
#include "athena/FileWriter.hpp" #include "athena/FileWriter.hpp"
#include <cstring>
namespace athena::io { namespace athena::io {
void TransactionalFileWriter::seek(atInt64 pos, SeekOrigin origin) { void TransactionalFileWriter::seek(atInt64 pos, SeekOrigin origin) {
switch (origin) { switch (origin) {

View File

@ -1,11 +1,8 @@
#include "athena/MemoryReader.hpp" #include "athena/MemoryReader.hpp"
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <iostream>
#include <cstring>
#include <algorithm> #include <algorithm>
#include <cstdio>
#include <cstring>
#ifdef HW_RVL #ifdef HW_RVL
#include <malloc.h> #include <malloc.h>

View File

@ -2,8 +2,6 @@
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include <vector>
#include <iostream>
#ifdef HW_RVL #ifdef HW_RVL
#include <malloc.h> #include <malloc.h>

View File

@ -1,18 +1,21 @@
#include "athena/Socket.hpp" #include "athena/Socket.hpp"
#ifndef _WIN32 #ifndef _WIN32
#include <sys/socket.h> #include <cerrno>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netdb.h> #include <netdb.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <sys/socket.h>
#include <unistd.h> #include <unistd.h>
#include <cerrno>
#else #else
#include <WinSock2.h> #include <WinSock2.h>
#include <Ws2tcpip.h> #include <Ws2tcpip.h>
#endif #endif
#include "athena/Global.hpp"
namespace athena::net { namespace athena::net {
/* Define the low-level send/receive flags, which depend on the OS */ /* Define the low-level send/receive flags, which depend on the OS */

View File

@ -1,15 +1,16 @@
#include "athena/Utility.hpp" #include "athena/Utility.hpp"
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <sstream>
#include <algorithm> #include <algorithm>
#include <cstdarg> #include <cstdarg>
#include <iterator>
#include <cstdio> #include <cstdio>
#include <sys/types.h> #include <cstdlib>
#include <sys/stat.h> #include <cstring>
#include <iterator>
#include <random> #include <random>
#include <sstream>
#include <sys/stat.h>
#include <sys/types.h>
#include "utf8proc.h" #include "utf8proc.h"
#ifdef _MSC_VER #ifdef _MSC_VER

View File

@ -1,10 +1,8 @@
#include "athena/VectorWriter.hpp" #include "athena/VectorWriter.hpp"
#include <cstdio> #include <algorithm>
#include <cstring> #include <cstring>
#include <vector> #include <vector>
#include <iostream>
#include <algorithm>
namespace athena::io { namespace athena::io {