diff options
author | Jose <jose@zeroc.com> | 2017-01-09 17:01:31 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2017-01-09 17:01:31 +0100 |
commit | d4ed7973f1824478477be29989fc125b04207494 (patch) | |
tree | ec488f46a0ee15f987a0a24c87d1fe0a999cc168 /cpp/src/slice2confluence | |
parent | IceSSL C#/Java test fixes to sync with C++ changes (diff) | |
download | ice-d4ed7973f1824478477be29989fc125b04207494.tar.bz2 ice-d4ed7973f1824478477be29989fc125b04207494.tar.xz ice-d4ed7973f1824478477be29989fc125b04207494.zip |
Fixed (ICE-6694) - Unicode output in command line tools
Diffstat (limited to 'cpp/src/slice2confluence')
-rw-r--r-- | cpp/src/slice2confluence/ConfluenceOutput.cpp | 14 | ||||
-rw-r--r-- | cpp/src/slice2confluence/ConfluenceOutput.h | 9 | ||||
-rw-r--r-- | cpp/src/slice2confluence/Gen.cpp | 17 | ||||
-rw-r--r-- | cpp/src/slice2confluence/Main.cpp | 35 |
4 files changed, 48 insertions, 27 deletions
diff --git a/cpp/src/slice2confluence/ConfluenceOutput.cpp b/cpp/src/slice2confluence/ConfluenceOutput.cpp index a1176f7cc37..cac2dc645e4 100644 --- a/cpp/src/slice2confluence/ConfluenceOutput.cpp +++ b/cpp/src/slice2confluence/ConfluenceOutput.cpp @@ -1,3 +1,13 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#include <IceUtil/ConsoleUtil.h> #include <ConfluenceOutput.h> #include <iostream> #include <sstream> @@ -795,8 +805,8 @@ Confluence::ConfluenceOutput::getMarkerLimits(const string& str) } else { - cerr << "getEscaperLimits FOUND START OF ESCAPE MARKER WITH NO MATCHING END IN STRING:" << endl - << str.substr(start) << endl; + consoleErr << "getEscaperLimits FOUND START OF ESCAPE MARKER WITH NO MATCHING END IN STRING:" + << endl << str.substr(start) << endl; break; } } diff --git a/cpp/src/slice2confluence/ConfluenceOutput.h b/cpp/src/slice2confluence/ConfluenceOutput.h index a97577c39c5..d7e9e0b4637 100644 --- a/cpp/src/slice2confluence/ConfluenceOutput.h +++ b/cpp/src/slice2confluence/ConfluenceOutput.h @@ -1,3 +1,12 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + #ifndef CONFLUENCE_OUTPUT #define CONFLUENCE_OUTPUT diff --git a/cpp/src/slice2confluence/Gen.cpp b/cpp/src/slice2confluence/Gen.cpp index b97445781f1..44890c0d368 100644 --- a/cpp/src/slice2confluence/Gen.cpp +++ b/cpp/src/slice2confluence/Gen.cpp @@ -11,6 +11,7 @@ #include <IceUtil/Functional.h> #include <IceUtil/StringUtil.h> #include <IceUtil/FileUtil.h> +#include <IceUtil/ConsoleUtil.h> #include <Slice/FileTracker.h> #include <Gen.h> #include <string.h> @@ -1228,8 +1229,8 @@ Slice::GeneratorBase::getComment(const ContainedPtr& contained, const ContainerP if(_warnOldCommentFiles.find(fileName) == _warnOldCommentFiles.end()) { _warnOldCommentFiles.insert(fileName); - cerr << fileName << ": warning: file contains old-style javadoc link syntax: `[" << literal << "]'" - << endl; + consoleErr << fileName << ": warning: file contains old-style javadoc link syntax: `[" << literal + << "]'" << endl; } } else if(s[i] == '{') @@ -1271,8 +1272,8 @@ Slice::GeneratorBase::getComment(const ContainedPtr& contained, const ContainerP if(summary && _warnSummary && summarySize > _warnSummary) { - cerr << contained->file() << ": warning: summary size (" << summarySize << ") exceeds " << _warnSummary - << " characters: `" << comment << "'" << endl; + consoleErr << contained->file() << ": warning: summary size (" << summarySize << ") exceeds " << _warnSummary + << " characters: `" << comment << "'" << endl; } return trim(_out.convertCommentHTML(removeNewlines(comment))); } @@ -1706,13 +1707,13 @@ Slice::GeneratorBase::warnOldStyleIdent(const string& str, const string& fileNam lastName = newName.substr(pos + 1); } - cerr << fileName << ": warning: file contains old-style javadoc identifier syntax: `" << str << "'." - << " Use `'" << newName << "'"; + consoleErr << fileName << ": warning: file contains old-style javadoc identifier syntax: `" << str << "'." + << " Use `'" << newName << "'"; if(!alternateName.empty()) { - cerr << " or `" << alternateName << "' if `" << lastName << "' is a member"; + consoleErr << " or `" << alternateName << "' if `" << lastName << "' is a member"; } - cerr << endl; + consoleErr << endl; } } diff --git a/cpp/src/slice2confluence/Main.cpp b/cpp/src/slice2confluence/Main.cpp index ad6b22c9307..38a38ff8d87 100644 --- a/cpp/src/slice2confluence/Main.cpp +++ b/cpp/src/slice2confluence/Main.cpp @@ -11,6 +11,7 @@ #include <IceUtil/CtrlCHandler.h> #include <IceUtil/Mutex.h> #include <IceUtil/MutexPtrLock.h> +#include <IceUtil/ConsoleUtil.h> #include <Slice/Preprocessor.h> #include <Slice/FileTracker.h> #include <Slice/Util.h> @@ -19,7 +20,7 @@ using namespace std; using namespace Slice; -using namespace IceUtil; +using namespace IceUtilInternal; namespace { @@ -80,8 +81,8 @@ interruptedCallback(int signal) void usage(const string& n) { - getErrorStream() << "Usage: " << n << " [options] slice-files...\n"; - getErrorStream() << + consoleErr << "Usage: " << n << " [options] slice-files...\n"; + consoleErr << "Options:\n" "-h, --help Show this message.\n" "-v, --version Display the Ice version.\n" @@ -144,7 +145,7 @@ compile(const vector<string>& argv) } catch(const IceUtilInternal::BadOptException& e) { - getErrorStream() << argv[0] << ": error: " << e.reason << endl; + consoleErr << argv[0] << ": error: " << e.reason << endl; if(!validate) { usage(argv[0]); @@ -160,7 +161,7 @@ compile(const vector<string>& argv) if(opts.isSet("version")) { - getErrorStream() << ICE_STRING_VERSION << endl; + consoleErr << ICE_STRING_VERSION << endl; return EXIT_SUCCESS; } @@ -207,8 +208,8 @@ compile(const vector<string>& argv) s >> indexCount; if(!s) { - getErrorStream() << argv[0] << ": error: the --index operation requires a positive integer argument" - << endl; + consoleErr << argv[0] << ": error: the --index operation requires a positive integer argument" + << endl; if(!validate) { usage(argv[0]); @@ -231,8 +232,8 @@ compile(const vector<string>& argv) s >> summaryCount; if(!s) { - getErrorStream() << argv[0] << ": error: the --summary operation requires a positive integer argument" - << endl; + consoleErr << argv[0] << ": error: the --summary operation requires a positive integer argument" + << endl; if(!validate) { usage(argv[0]); @@ -249,7 +250,7 @@ compile(const vector<string>& argv) if(args.empty()) { - getErrorStream() << argv[0] << ": error: no input file" << endl; + consoleErr << argv[0] << ": error: no input file" << endl; if(!validate) { usage(argv[0]); @@ -325,19 +326,19 @@ compile(const vector<string>& argv) // created files. FileTracker::instance()->cleanup(); p->destroy(); - getErrorStream() << argv[0] << ": error: " << ex.reason() << endl; + consoleErr << argv[0] << ": error: " << ex.reason() << endl; return EXIT_FAILURE; } catch(const string& err) { FileTracker::instance()->cleanup(); - getErrorStream() << argv[0] << ": error: " << err << endl; + consoleErr << argv[0] << ": error: " << err << endl; status = EXIT_FAILURE; } catch(const char* err) { FileTracker::instance()->cleanup(); - getErrorStream() << argv[0] << ": error: " << err << endl; + consoleErr << argv[0] << ": error: " << err << endl; status = EXIT_FAILURE; } } @@ -370,22 +371,22 @@ int main(int argc, char* argv[]) } catch(const std::exception& ex) { - getErrorStream() << args[0] << ": error:" << ex.what() << endl; + consoleErr << args[0] << ": error:" << ex.what() << endl; return EXIT_FAILURE; } catch(const std::string& msg) { - getErrorStream() << args[0] << ": error:" << msg << endl; + consoleErr << args[0] << ": error:" << msg << endl; return EXIT_FAILURE; } catch(const char* msg) { - getErrorStream() << args[0] << ": error:" << msg << endl; + consoleErr << args[0] << ": error:" << msg << endl; return EXIT_FAILURE; } catch(...) { - getErrorStream() << args[0] << ": error:" << "unknown exception" << endl; + consoleErr << args[0] << ": error:" << "unknown exception" << endl; return EXIT_FAILURE; } } |