From bbc0f6f85961c2b6c6314e327cc451d66f18ea06 Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Thu, 10 Feb 2011 02:47:41 +0000 Subject: [PATCH] Document some utility methods. Originally committed to SVN as r5345. --- aegisub/libaegisub/include/libaegisub/util.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/aegisub/libaegisub/include/libaegisub/util.h b/aegisub/libaegisub/include/libaegisub/util.h index fd0600224..0d691093a 100644 --- a/aegisub/libaegisub/include/libaegisub/util.h +++ b/aegisub/libaegisub/include/libaegisub/util.h @@ -32,12 +32,28 @@ namespace agi { namespace util { + // Calculate midpoint from a list of Integers template inline T mid(T a, T b, T c) { return std::max(a, std::min(b, c)); } + // Get the parent directory of a path. + // @param path Path to process. const std::string DirName(const std::string& path); + + // Rename a file. + // @param from Source. + // @param to Destination. void Rename(const std::string& from, const std::string& to); + + // Get time sutable for logging mechinisms. + // @param tv timeval void time_log(agi_timeval &tv); + + // Make all alphabetic characters lowercase. + // @param str Input string void str_lower(std::string &str); + + // Convert a string to Integer. + // @param str Input string int strtoi(std::string &str); struct delete_ptr {