/////////////////////////////////////////////////////////////////// // Utilities.cpp - collection of title and logging functionality // // // // Application: Help for CSE687 Pr#2, Spring 2015 // // Platform: Dell XPS 2720, Win 8.1 Pro, Visual Studio 2013 // // Author: Jim Fawcett, CST 4-187, 443-3948 // // jfawcett@twcny.rr.com // /////////////////////////////////////////////////////////////////// #include "utilities.h" #include void title(const std::string& text, char underline) { std::cout << "\n " << text; std::cout << "\n " << std::string(text.size() + 2, underline); if (underline == '=') std::cout << "\n"; } void logit::show() { std::cout << "\n--start of log:"; std::cout << out_.str() << "\n--end of log\n"; out_.clear(); } void logit::start() { running_ = true; } void logit::stop() { running_ = false; } void logit::clear() { out_.str(""); } bool logit::running() { return running_; } void logit::put(char ch) { out_.put(ch); } logit& operator<<(logit& out, const std::string& in) { if (out.running()) for (auto ch : in) out.put(ch); return out; } logit mtLog; Cosmetic::~Cosmetic() { std::cout << "\n\n"; } Cosmetic cosmetic;