diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2017-05-05 21:21:39 (GMT) |
---|---|---|
committer | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2017-05-05 22:03:47 (GMT) |
commit | f3e216131b7b0a889507c3c4100b298c75ad3d84 (patch) | |
tree | 7db2f8c18dd770894d1e05b5bdb07a01e8dd7a73 /Source | |
parent | 9535823b2cff81b05e4c6b64016a95e2264ecda5 (diff) | |
download | CMake-f3e216131b7b0a889507c3c4100b298c75ad3d84.zip CMake-f3e216131b7b0a889507c3c4100b298c75ad3d84.tar.gz CMake-f3e216131b7b0a889507c3c4100b298c75ad3d84.tar.bz2 |
cmServer: include what you use
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmFileMonitor.cxx | 4 | ||||
-rw-r--r-- | Source/cmFileMonitor.h | 4 | ||||
-rw-r--r-- | Source/cmServer.cxx | 19 | ||||
-rw-r--r-- | Source/cmServer.h | 7 | ||||
-rw-r--r-- | Source/cmServerConnection.cxx | 3 | ||||
-rw-r--r-- | Source/cmServerConnection.h | 14 | ||||
-rw-r--r-- | Source/cmServerProtocol.cxx | 21 | ||||
-rw-r--r-- | Source/cmServerProtocol.h | 16 |
8 files changed, 43 insertions, 45 deletions
diff --git a/Source/cmFileMonitor.cxx b/Source/cmFileMonitor.cxx index ed794c3..6971465 100644 --- a/Source/cmFileMonitor.cxx +++ b/Source/cmFileMonitor.cxx @@ -5,9 +5,9 @@ #include "cmsys/SystemTools.hxx" #include <cassert> -#include <iostream> -#include <set> +#include <stddef.h> #include <unordered_map> +#include <utility> namespace { void on_directory_change(uv_fs_event_t* handle, const char* filename, diff --git a/Source/cmFileMonitor.h b/Source/cmFileMonitor.h index 8574db0..d7ec92a 100644 --- a/Source/cmFileMonitor.h +++ b/Source/cmFileMonitor.h @@ -2,7 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #pragma once -#include "cmConfigure.h" // IWYU pragma: keep +#include "cmConfigure.h" #include <functional> #include <string> @@ -14,6 +14,8 @@ class cmRootWatcher; class cmFileMonitor { + CM_DISABLE_COPY(cmFileMonitor) + public: cmFileMonitor(uv_loop_t* l); ~cmFileMonitor(); diff --git a/Source/cmServer.cxx b/Source/cmServer.cxx index 5a71dc0..19bdd45 100644 --- a/Source/cmServer.cxx +++ b/Source/cmServer.cxx @@ -6,18 +6,15 @@ #include "cmServerDictionary.h" #include "cmServerProtocol.h" #include "cmSystemTools.h" -#include "cmVersionMacros.h" -#include "cmake.h" - -#if defined(CMAKE_BUILD_WITH_CMAKE) #include "cm_jsoncpp_reader.h" -#include "cm_jsoncpp_value.h" -#endif +#include "cm_jsoncpp_writer.h" +#include "cmake.h" +#include "cmsys/FStream.hxx" #include <algorithm> -#include <fstream> -#include <iostream> -#include <memory> +#include <cassert> +#include <cstdint> +#include <utility> class cmServer::DebugInfo { @@ -270,10 +267,8 @@ void cmServer::WriteJsonObject(const Json::Value& jsonValue, } if (!debug->OutputFile.empty()) { - std::ofstream myfile; - myfile.open(debug->OutputFile); + cmsys::ofstream myfile(debug->OutputFile.c_str()); myfile << result; - myfile.close(); } } diff --git a/Source/cmServer.h b/Source/cmServer.h index 7f29e32..b814050 100644 --- a/Source/cmServer.h +++ b/Source/cmServer.h @@ -2,13 +2,10 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #pragma once -#include "cmListFileCache.h" -#include "cmState.h" +#include "cmConfigure.h" -#if defined(CMAKE_BUILD_WITH_CMAKE) #include "cm_jsoncpp_value.h" #include "cm_uv.h" -#endif #include <string> #include <vector> @@ -21,6 +18,8 @@ class cmServerResponse; class cmServer { + CM_DISABLE_COPY(cmServer) + public: class DebugInfo; diff --git a/Source/cmServerConnection.cxx b/Source/cmServerConnection.cxx index 008052b..36312ed 100644 --- a/Source/cmServerConnection.cxx +++ b/Source/cmServerConnection.cxx @@ -2,10 +2,9 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmServerConnection.h" -#include "cmServerDictionary.h" - #include "cmFileMonitor.h" #include "cmServer.h" +#include "cmServerDictionary.h" #include <assert.h> #include <string.h> diff --git a/Source/cmServerConnection.h b/Source/cmServerConnection.h index 1fabe37..b96bf3c 100644 --- a/Source/cmServerConnection.h +++ b/Source/cmServerConnection.h @@ -2,21 +2,19 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #pragma once -#include "cmConfigure.h" // IWYU pragma: keep +#include "cmConfigure.h" -#include <string> -#include <vector> - -#if defined(CMAKE_BUILD_WITH_CMAKE) #include "cm_uv.h" -#endif -class cmServer; +#include <string> + class cmFileMonitor; -class LoopGuard; +class cmServer; class cmServerConnection { + CM_DISABLE_COPY(cmServerConnection) + public: cmServerConnection(); virtual ~cmServerConnection(); diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index 11ee897..4e9e80f 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -4,27 +4,32 @@ #include "cmExternalMakefileProjectGenerator.h" #include "cmFileMonitor.h" +#include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmLinkLineComputer.h" -#include "cmListFileCache.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmServer.h" #include "cmServerDictionary.h" #include "cmSourceFile.h" +#include "cmState.h" +#include "cmStateDirectory.h" +#include "cmStateSnapshot.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" +#include "cm_uv.h" #include "cmake.h" -#include "cmServerDictionary.h" - -#if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cm_jsoncpp_reader.h" -#include "cm_jsoncpp_value.h" -#endif - #include <algorithm> +#include <cassert> +#include <cstddef> +#include <functional> +#include <limits> +#include <map> +#include <set> #include <string> +#include <unordered_map> #include <vector> // Get rid of some windows macros: diff --git a/Source/cmServerProtocol.h b/Source/cmServerProtocol.h index 027f145..83b3d58 100644 --- a/Source/cmServerProtocol.h +++ b/Source/cmServerProtocol.h @@ -2,20 +2,17 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #pragma once -#include "cmListFileCache.h" -#include "cmake.h" +#include "cmConfigure.h" -#if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cm_jsoncpp_writer.h" -#endif +#include "cm_jsoncpp_value.h" +#include "cmake.h" #include <memory> #include <string> +#include <utility> -class cmake; class cmFileMonitor; class cmServer; - class cmServerRequest; class cmServerResponse @@ -72,8 +69,11 @@ private: class cmServerProtocol { + CM_DISABLE_COPY(cmServerProtocol) + public: - virtual ~cmServerProtocol() {} + cmServerProtocol() = default; + virtual ~cmServerProtocol() = default; virtual std::pair<int, int> ProtocolVersion() const = 0; virtual bool IsExperimental() const = 0; |