Sierra Toolkit
Version of the Day
|
Class object_phrase makes a pretty string for those annoying plural or singular noun/verb phrases. More...
#include <StringUtil.hpp>
Public Member Functions | |
object_phrase (int n, const char *noun, const char *singlar="is", const char *plural="are") | |
std::ostream & | print (std::ostream &os) const |
Member function print writes the object phrase to the output stream. More... | |
operator std::string () const | |
Member function operator std::string returns a string of the object phrase. More... | |
Class object_phrase makes a pretty string for those annoying plural or singular noun/verb phrases.
The output is plural no nouns, when n is zero,
singular 1 noun, when n is 1, or
plural n nouns, when n is greater than 1.
Definition at line 400 of file StringUtil.hpp.
|
inline |
Creates a new object_phrase instance.
n | an int value of the quantity of objects |
noun | a char const pointer to the name of the object. |
singlar | a char singular form of the verb acting on the object. |
plural | a char plural form of the verb acting on the object. |
Definition at line 415 of file StringUtil.hpp.
std::ostream & sierra::object_phrase::print | ( | std::ostream & | os | ) | const |
Member function print writes the object phrase to the output stream.
os | a std::ostream reference to the output stream to write to. |
Definition at line 187 of file StringUtil.cpp.
sierra::object_phrase::operator std::string | ( | ) | const |
Member function operator std::string returns a string of the object phrase.
Definition at line 201 of file StringUtil.cpp.