ocarina/include/core/string.h

40 lines
841 B
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);
}
#endif /* OCARINA_CORE_STRING_H */