From e5b76d6660ea7b450ff1b2c407f03bc200010474 Mon Sep 17 00:00:00 2001 From: Felix Schindler <felix.schindler@wwu.de> Date: Sat, 4 Aug 2018 23:59:35 +0200 Subject: [PATCH] whitespace --- dune/xt/common/string.hh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dune/xt/common/string.hh b/dune/xt/common/string.hh index 823a976c8..2fc93024e 100644 --- a/dune/xt/common/string.hh +++ b/dune/xt/common/string.hh @@ -35,6 +35,7 @@ namespace Dune { namespace XT { namespace Common { + // forward, std::string variant needed in internal::convert_from_string /** @@ -51,6 +52,7 @@ tokenize(const std::string& msg, const std::string& separators, const boost::algorithm::token_compress_mode_type mode = boost::algorithm::token_compress_off); + } // namespace Common } // namespace XT } // namespace Dune @@ -61,8 +63,10 @@ namespace Dune { namespace XT { namespace Common { + static constexpr const std::size_t default_to_string_precision = 6u; + /** * \brief Reads an object from a string. * \sa internal::convert_from_string for implementations @@ -78,6 +82,7 @@ static inline T from_string(std::string ss, const size_t size = 0, const size_t return internal::convert_from_string<T>(ss, size, cols); } + /** * \brief Converts an object to string. * \sa internal::convert_to_string for implementations @@ -131,6 +136,7 @@ std::string whitespaceify(const T& t, const char whitespace = ' ') return ret; } // ... whitespaceify(...) + template <class T> inline std::vector<T> tokenize(const std::string& msg, const std::string& separators, const boost::algorithm::token_compress_mode_type mode) @@ -145,6 +151,7 @@ tokenize(const std::string& msg, const std::string& separators, const boost::alg return ret; } // ... tokenize(...) + template <> inline std::vector<std::string> tokenize(const std::string& msg, const std::string& separators, const boost::algorithm::token_compress_mode_type mode) @@ -166,6 +173,7 @@ inline std::string stringFromTime(time_t cur_time = time(NULL)) return ctime(&cur_time); } + //! helper struct for lexical cast // see http://stackoverflow.com/a/2079728 template <typename ElemT> @@ -184,6 +192,7 @@ struct HexToString } }; + static inline char** vector_to_main_args(const std::vector<std::string>& args) { char** argv = new char*[args.size()]; @@ -194,6 +203,7 @@ static inline char** vector_to_main_args(const std::vector<std::string>& args) return argv; } // ... vector_to_main_args(...) + } // namespace Common } // namespace XT } // namespace Dune -- GitLab