39 lines
852 B
C++
39 lines
852 B
C++
/**
|
|
* Copyright 2015 (c) Anna Schumaker.
|
|
*/
|
|
#ifndef OCARINA_CORE_STRING_H
|
|
#define OCARINA_CORE_STRING_H
|
|
|
|
#include <glib.h>
|
|
#include <string>
|
|
|
|
/**
|
|
* Namespace for string formatting functions.
|
|
*/
|
|
namespace string
|
|
{
|
|
|
|
/**
|
|
* 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 &);
|
|
}
|
|
|
|
|
|
/*
|
|
* 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);
|
|
|
|
/*
|
|
* 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);
|
|
|
|
#endif /* OCARINA_CORE_STRING_H */
|