Skip to content

Commit

Permalink
Corrected ortograph of some core classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanemagnenat committed Apr 29, 2023
1 parent 9a1c29f commit 5068f32
Show file tree
Hide file tree
Showing 77 changed files with 1,921 additions and 1,921 deletions.
20 changes: 10 additions & 10 deletions libgag/include/FormatableString.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ namespace GAGCore {
/*!
* string that can be used for argument substitution.
* Example :
* FormatableString fs("Hello %0");
* FormattableString fs("Hello %0");
* cout << fs.arg("World");
*/
class FormatableString : public std::string
class FormattableString : public std::string
{
private:
/*!
Expand All @@ -45,14 +45,14 @@ namespace GAGCore {

public:

FormatableString() : std::string(), argLevel(0) { }
FormattableString() : std::string(), argLevel(0) { }
/*!
* Creates a new FormatableString with format string set to s.
* Creates a new FormattableString with format string set to s.
* \param s A string with indicators for argument substitution.
* Each indicator is the % symbol followed by a number. The number
* is the index of the corresponding argument (starting at %0).
*/
FormatableString(const std::string &s)
FormattableString(const std::string &s)
: std::string(s), argLevel(0) { }

/*!
Expand All @@ -63,7 +63,7 @@ namespace GAGCore {
* \param fillChar Character used to pad the number to reach fieldWidth
* \see arg(const T& value)
*/
FormatableString &arg(int value, int fieldWidth = 0, int base = 10, char fillChar = ' ');
FormattableString &arg(int value, int fieldWidth = 0, int base = 10, char fillChar = ' ');

/*!
* Replace the next arg by an int value.
Expand All @@ -73,7 +73,7 @@ namespace GAGCore {
* \param fillChar Character used to pad the number to reach fieldWidth
* \see arg(const T& value)
*/
FormatableString &arg(unsigned value, int fieldWidth = 0, int base = 10, char fillChar = ' ');
FormattableString &arg(unsigned value, int fieldWidth = 0, int base = 10, char fillChar = ' ');

/*!
* Replace the next arg by a float value.
Expand All @@ -83,14 +83,14 @@ namespace GAGCore {
* \param fillChar Character used to pad the number to reach fieldWidth.
* \see arg(const T& value)
*/
FormatableString &arg(float value, int fieldWidth = 0, int precision = 6, char fillChar = ' ');
FormattableString &arg(float value, int fieldWidth = 0, int precision = 6, char fillChar = ' ');

/*!
* Replace the next arg by a value that can be passed to an ostringstream.
* The first call to arg replace %0, the second %1, and so on.
* \param value Value used to replace the current argument.
*/
template <typename T> FormatableString &arg(const T& value)
template <typename T> FormattableString &arg(const T& value)
{
// transform value into std::string
std::ostringstream oss;
Expand All @@ -107,7 +107,7 @@ namespace GAGCore {
* counter.
* \param str New format string.
*/
FormatableString& operator=(const std::string& str) ;
FormattableString& operator=(const std::string& str) ;

/*!
* Casts this string to a const char*
Expand Down
2 changes: 1 addition & 1 deletion libgag/include/Toolkit.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace GAGCore
class StringTable;
class GraphicContext;

//! Toolkit is a ressource server
//! Toolkit is a resource server
class Toolkit
{
private:
Expand Down
10 changes: 5 additions & 5 deletions libgag/src/FormatableString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <FormatableString.h>

namespace GAGCore {
void FormatableString::proceedReplace(const std::string &replacement)
void FormattableString::proceedReplace(const std::string &replacement)
{
std::ostringstream search;
search << "%" << this->argLevel;
Expand All @@ -43,7 +43,7 @@ namespace GAGCore {
++argLevel;
}

FormatableString &FormatableString::arg(int value, int fieldWidth, int base, char fillChar)
FormattableString &FormattableString::arg(int value, int fieldWidth, int base, char fillChar)
{
std::ostringstream oss;
oss << std::setbase(base);
Expand All @@ -59,7 +59,7 @@ namespace GAGCore {
return *this;
}

FormatableString &FormatableString::arg(unsigned value, int fieldWidth, int base, char fillChar)
FormattableString &FormattableString::arg(unsigned value, int fieldWidth, int base, char fillChar)
{
std::ostringstream oss;
oss << std::setbase(base);
Expand All @@ -75,7 +75,7 @@ namespace GAGCore {
return *this;
}

FormatableString &FormatableString::arg(float value, int fieldWidth, int precision, char fillChar)
FormattableString &FormattableString::arg(float value, int fieldWidth, int precision, char fillChar)
{
std::ostringstream oss;
oss.precision(precision);
Expand All @@ -92,7 +92,7 @@ namespace GAGCore {
return *this;
}

FormatableString &FormatableString::operator=(const std::string& str)
FormattableString &FormattableString::operator=(const std::string& str)
{
this->assign(str);
this->argLevel = 0;
Expand Down
2 changes: 1 addition & 1 deletion libgag/src/GUIProgressBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace GAGGUI
Style::style->drawProgressBar(parent->getSurface(), x, y+hDec, w, value, range);
if (fontPtr)
{
FormatableString text = FormatableString(format).arg((value*100)/range);
FormattableString text = FormattableString(format).arg((value*100)/range);
int textW = fontPtr->getStringWidth(text.c_str());
int textH = fontPtr->getStringHeight(text.c_str());
parent->getSurface()->drawString(x + ((w-textW) >> 1), y + ((h-textH) >> 1), fontPtr, text);
Expand Down
10 changes: 5 additions & 5 deletions libgag/src/KeyPress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ std::string KeyPress::format() const
s+="<meta>";
if(shift)
s+="<shift>";
s+=FormatableString("<%0>").arg(key);
s+=FormattableString("<%0>").arg(key);
return s;
}

Expand Down Expand Up @@ -248,13 +248,13 @@ std::string KeyPress::getTranslated() const
}
//Visual order, control always first. Rather than alt-control-a for example, its control-alt-a
if(alt)
str=FormatableString(table->getString("[alt %0]")).arg(str);
str=FormattableString(table->getString("[alt %0]")).arg(str);
if(meta)
str=FormatableString(table->getString("[meta %0]")).arg(str);
str=FormattableString(table->getString("[meta %0]")).arg(str);
if(shift)
str=FormatableString(table->getString("[shift %0]")).arg(str);
str=FormattableString(table->getString("[shift %0]")).arg(str);
if(control)
str=FormatableString(table->getString("[control %0]")).arg(str);
str=FormattableString(table->getString("[control %0]")).arg(str);
return str;
}

Expand Down
2 changes: 1 addition & 1 deletion libgag/src/StringTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ namespace GAGCore
bool lcwp=false;
int baseCount=0;
const std::string &s = it->first;
// we check that we only have valid format (from a FormatableString point of view)...
// we check that we only have valid format (from a FormattableString point of view)...
for (size_t j=0; j<s.length(); j++)
{
char c = s[j];
Expand Down
Loading

0 comments on commit 5068f32

Please sign in to comment.