protected:
std::ostream& sout_; // not owned; will not delete
public:
- /// Decide whether to write comments.
- enum class CommentStyle {
- None, ///< Drop all comments.
- Most, ///< Recover odd behavior of previous versions (not implemented yet).
- All ///< Keep all comments.
+ /// Scoped enums are not available until C++11.
+ struct CommentStyle {
+ /// Decide whether to write comments.
+ enum Enum {
+ None, ///< Drop all comments.
+ Most, ///< Recover odd behavior of previous versions (not implemented yet).
+ All ///< Keep all comments.
+ };
};
/// Keep a reference, but do not take ownership of `sout`.
/** \brief How to write comments.
* Default: All
*/
- StreamWriter::CommentStyle cs_;
+ StreamWriter::CommentStyle::Enum cs_;
/** \brief Write in human-friendly style.
If "", then skip all indentation and newlines.
BuiltStyledStreamWriter(
std::ostream* sout,
std::string const& indentation,
- StreamWriter::CommentStyle cs,
+ StreamWriter::CommentStyle::Enum cs,
std::string const& colonSymbol,
std::string const& nullSymbol,
std::string const& endingLineFeedSymbol);
std::string indentString_;
int rightMargin_;
std::string indentation_;
- CommentStyle cs_;
+ CommentStyle::Enum cs_;
std::string colonSymbol_;
std::string nullSymbol_;
std::string endingLineFeedSymbol_;
BuiltStyledStreamWriter::BuiltStyledStreamWriter(
std::ostream* sout,
std::string const& indentation,
- StreamWriter::CommentStyle cs,
+ StreamWriter::CommentStyle::Enum cs,
std::string const& colonSymbol,
std::string const& nullSymbol,
std::string const& endingLineFeedSymbol)