diff options
author | Kitware Robot <kwrobot@kitware.com> | 2016-05-16 14:34:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-05-16 20:05:19 (GMT) |
commit | d9fd2f5402eeaa345691313658e02b51038f570b (patch) | |
tree | dca71b9a7e267f4c6300da3eb770415381726785 /Source/CPack/cmCPackLog.h | |
parent | 82df6deaafb36cbbfd450202bb20b320f637751a (diff) | |
download | CMake-d9fd2f5402eeaa345691313658e02b51038f570b.zip CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.gz CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.bz2 |
Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update
all our C++ code to a new style defined by `.clang-format`.
Use `clang-format` version 3.8.
* If you reached this commit for a line in `git blame`, re-run the blame
operation starting at the parent of this commit to see older history
for the content.
* See the parent commit for instructions to rebase a change across this
style transition commit.
Diffstat (limited to 'Source/CPack/cmCPackLog.h')
-rw-r--r-- | Source/CPack/cmCPackLog.h | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/Source/CPack/cmCPackLog.h b/Source/CPack/cmCPackLog.h index 7a7ff58..41871cc 100644 --- a/Source/CPack/cmCPackLog.h +++ b/Source/CPack/cmCPackLog.h @@ -15,24 +15,23 @@ #include "cmObject.h" -#define cmCPack_Log(ctSelf, logType, msg) \ - do { \ - std::ostringstream cmCPackLog_msg; \ - cmCPackLog_msg << msg; \ - (ctSelf)->Log(logType, __FILE__, __LINE__, cmCPackLog_msg.str().c_str());\ - } while ( 0 ) +#define cmCPack_Log(ctSelf, logType, msg) \ + do { \ + std::ostringstream cmCPackLog_msg; \ + cmCPackLog_msg << msg; \ + (ctSelf)->Log(logType, __FILE__, __LINE__, cmCPackLog_msg.str().c_str()); \ + } while (0) #ifdef cerr -# undef cerr +#undef cerr #endif #define cerr no_cerr_use_cmCPack_Log #ifdef cout -# undef cout +#undef cout #endif #define cout no_cout_use_cmCPack_Log - /** \class cmCPackLog * \brief A container for CPack generators * @@ -45,7 +44,8 @@ public: cmCPackLog(); ~cmCPackLog(); - enum __log_tags { + enum __log_tags + { NOTAG = 0, LOG_OUTPUT = 0x1, LOG_VERBOSE = 0x2, @@ -56,19 +56,19 @@ public: //! Various signatures for logging. void Log(const char* file, int line, const char* msg) - { + { this->Log(LOG_OUTPUT, file, line, msg); - } + } void Log(const char* file, int line, const char* msg, size_t length) - { + { this->Log(LOG_OUTPUT, file, line, msg, length); - } + } void Log(int tag, const char* file, int line, const char* msg) - { + { this->Log(tag, file, line, msg, strlen(msg)); - } + } void Log(int tag, const char* file, int line, const char* msg, - size_t length); + size_t length); //! Set Verbose void VerboseOn() { this->SetVerbose(true); } @@ -126,11 +126,11 @@ private: std::string WarningPrefix; std::string ErrorPrefix; - std::ostream *DefaultOutput; - std::ostream *DefaultError; + std::ostream* DefaultOutput; + std::ostream* DefaultError; std::string LogOutputFileName; - std::ostream *LogOutput; + std::ostream* LogOutput; // Do we need to cleanup log output stream bool LogOutputCleanup; }; @@ -139,13 +139,16 @@ class cmCPackLogWrite { public: cmCPackLogWrite(const char* data, size_t length) - : Data(data), Length(length) {} + : Data(data) + , Length(length) + { + } const char* Data; size_t Length; }; -inline std::ostream& operator<< (std::ostream& os, const cmCPackLogWrite& c) +inline std::ostream& operator<<(std::ostream& os, const cmCPackLogWrite& c) { os.write(c.Data, c.Length); os.flush(); |