Esempio n. 1
0
	/**@brief A Function to print out all the current arguments in an organized
	 *table
	 * @param commandLineArgumentsMap A map of strings pairs of the current
	 *arguments
	 * @param out The std::ostream object to print the info to
	 *
	 */
	void writeOutCommandLineArguments(
			const std::map<std::string, std::string> &commandLineArgumentsMap,
			std::ostream &out) {
		uint32_t optionCount = 0;
		std::vector<std::string> columnNames = { "OptionNum", "Flag", "Option" };
		std::vector<std::vector<std::string>> content;
		for (const auto &mContent : commandLineArgumentsMap) {
			content.emplace_back(
					std::vector<std::string> { estd::to_string(optionCount) + ")",
							mContent.first, mContent.second });
			++optionCount;
		}
		printTableOrganized(content, columnNames, out);
	}
Esempio n. 2
0
	/**@brief Log the lap times to out in two columns separated by tab
	 * @param out The std::ostream object to log the times to
	 * @param formatted A bool whether the time should be
	 * @param decPlaces The number of decimal places to print if formatted
	 *
	 */
	void logLapTimes(std::ostream & out,
			bool formatted, int32_t decPlaces,
			bool endLastLap){
		if(endLastLap){
			startNewLap();
		}
		if(formatted){
			std::vector<VecStr> content;
			VecStr header {"lap", "time"};
			for(const auto & lt : lapTimes_){
				content.emplace_back(VecStr{lt.first,
					getTimeFormat(lt.second, true, decPlaces)});
			}
			printTableOrganized(content, header, out);
		}else{
			for(const auto & lt : lapTimes_){
				out << lt.first << "\t" << lt.second << "\n";
			}
		}
	}