47 lines
1.0 KiB
C++
47 lines
1.0 KiB
C++
/**
|
|
* 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 */
|