ocarina/include/core/string.h
Anna Schumaker 7733e24c07 string: Add a lowercase() function
This function strips out special characters and returns the lowercase
version of the string.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-30 09:32:50 -05:00

48 lines
1.0 KiB
C++

/**
* @file
* Copyright 2015 (c) Anna Schumaker.
*/
#ifndef OCARINA_CORE_STRING_H
#define OCARINA_CORE_STRING_H
#include <string>
/**
* Namespace for string formatting functions.
*/
namespace string
{
/**
* Convert an unsigned integer into a string.
* @param u Integer to be converted.
* @return u, in string form.
*/
const std::string utos(unsigned int);
/**
* Convert from seconds to a time string.
* @param sec Number of seconds.
* @return A string in mm:ss format.
*/
const std::string sec2str(unsigned int);
/**
* Convert from seconds to a detailed time string.
* @param sec Number of seconds.
* @return A string listing the length in terms of days,
* months, hours, minutes, and seconds.
*/
const std::string sec2str_detailed(unsigned int);
/**
* Convert a string to lowercase, stripping out special characters
* along the way.
* @param str Input string.
* @return The same string converted to lowercase.
*/
const std::string lowercase(const std::string &);
}
#endif /* OCARINA_CORE_STRING_H */