2015-01-26 09:40:48 -05:00
|
|
|
/**
|
|
|
|
* Copyright 2015 (c) Anna Schumaker.
|
|
|
|
*/
|
|
|
|
#ifndef OCARINA_CORE_STRING_H
|
|
|
|
#define OCARINA_CORE_STRING_H
|
|
|
|
|
2015-09-02 08:02:41 -04:00
|
|
|
#include <glib.h>
|
2015-01-26 09:40:48 -05:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Namespace for string formatting functions.
|
|
|
|
*/
|
|
|
|
namespace string
|
|
|
|
{
|
|
|
|
|
2015-01-30 09:32:27 -05:00
|
|
|
/**
|
|
|
|
* 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 &);
|
2015-01-26 09:40:48 -05:00
|
|
|
}
|
|
|
|
|
2015-09-01 08:58:34 -04:00
|
|
|
|
2015-09-02 08:02:41 -04:00
|
|
|
/*
|
|
|
|
* Convert number of seconds into a string with format mm:ss.
|
|
|
|
* This function allocates a new string that MUST be freed with g_free().
|
|
|
|
*/
|
|
|
|
gchar *string_sec2str(unsigned int);
|
|
|
|
|
2015-09-03 09:31:48 -04:00
|
|
|
/*
|
|
|
|
* Convert number of seconds into a long-form time string.
|
|
|
|
* This function allocates a new string that MUST be freed with g_free().
|
|
|
|
*/
|
|
|
|
gchar *string_sec2str_long(unsigned int);
|
|
|
|
|
2015-01-26 09:40:48 -05:00
|
|
|
#endif /* OCARINA_CORE_STRING_H */
|