diff --git a/alib2data/src/string/String.cpp b/alib2data/src/string/String.cpp index 6830d20cb73fc25df85cad373f628277ef85cbfc..208abc0a9650d7390ea4d8723acf5a269197e923 100644 --- a/alib2data/src/string/String.cpp +++ b/alib2data/src/string/String.cpp @@ -12,25 +12,34 @@ namespace string { -const std::set<alphabet::Symbol>& String::getAlphabet() const { - return this->getData().getAlphabet(); +const std::set < alphabet::Symbol > & String::getAlphabet ( ) const { + return this->getData ( ).getAlphabet ( ); } -void String::extendAlphabet(const std::set < alphabet::Symbol > & symbols ) { - this->getData().extendAlphabet(symbols); +void String::extendAlphabet ( const std::set < alphabet::Symbol > & symbols ) { + this->getData ( ).extendAlphabet ( symbols ); } -string::String stringFrom( const alphabet::Symbol& symbol ) { - return string::String { string::LinearString { std::vector<alphabet::Symbol> { symbol } } }; +string::String stringFrom ( const alphabet::Symbol & symbol ) { + return string::String { + string::LinearString { + std::vector < alphabet::Symbol > { + symbol + } + } + }; } -string::String stringFrom( const std::string& string ) { - return string::String { string::LinearString { string } }; +string::String stringFrom ( const std::string & string ) { + return string::String { + string::LinearString { + string + } + }; } -string::String stringFrom( const char* string ) { - return stringFrom( (std::string) string); +string::String stringFrom ( const char * string ) { + return stringFrom ( ( std::string ) string ); } } /* namespace string */ - diff --git a/alib2data/src/string/String.h b/alib2data/src/string/String.h index f6c2802b97afef494b3431fd840e35ca514b1a3a..1ff5d1d299ccbb94f1605f82bb1e81cc4ca1c9f8 100644 --- a/alib2data/src/string/String.h +++ b/alib2data/src/string/String.h @@ -19,29 +19,30 @@ namespace string { /** * Wrapper around strings. */ -class String : public alib::wrapper<StringBase>, public alib::WrapperBase { - using alib::wrapper<StringBase>::wrapper; +class String : public alib::wrapper < StringBase >, public alib::WrapperBase { + using alib::wrapper < StringBase >::wrapper; + public: - const std::set<alphabet::Symbol>& getAlphabet() const; - void extendAlphabet(const std::set < alphabet::Symbol > & symbols ); + const std::set < alphabet::Symbol > & getAlphabet ( ) const; + void extendAlphabet ( const std::set < alphabet::Symbol > & symbols ); }; -string::String stringFrom(const alphabet::Symbol& symbol); -string::String stringFrom(const std::string& str); -string::String stringFrom(const char* str); +string::String stringFrom ( const alphabet::Symbol & symbol ); +string::String stringFrom ( const std::string & str ); +string::String stringFrom ( const char * str ); } /* namespace string */ namespace std { -template<> -struct compare<::string::String> { - int operator()(const ::string::String& first, const ::string::String& second) const { - return first.getData().compare(second.getData()); +template < > +struct compare < ::string::String > { + int operator ()( const::string::String & first, const::string::String & second ) const { + return first.getData ( ).compare ( second.getData ( ) ); } + }; } /* namespace std */ #endif /* STRING_H_ */ - diff --git a/alib2data/src/string/StringBase.h b/alib2data/src/string/StringBase.h index f0ba7c10d840354ef86cd2444b1235172e2223b1..b6c173d8f0c7854af56a79c8b54eab947e0a8466 100644 --- a/alib2data/src/string/StringBase.h +++ b/alib2data/src/string/StringBase.h @@ -19,25 +19,25 @@ namespace string { */ class StringBase : public alib::ObjectBase { public: - virtual StringBase* clone() const = 0; - virtual StringBase* plunder() && = 0; + virtual StringBase * clone ( ) const = 0; + virtual StringBase * plunder ( ) && = 0; - virtual const std::set<alphabet::Symbol>& getAlphabet() const = 0; - virtual void extendAlphabet(const std::set<alphabet::Symbol>& symbols) = 0; + virtual const std::set < alphabet::Symbol > & getAlphabet ( ) const = 0; + virtual void extendAlphabet ( const std::set < alphabet::Symbol > & symbols ) = 0; }; } /* namespace string */ namespace std { -template<> -struct compare<::string::StringBase> { - int operator()(const ::string::StringBase& first, const ::string::StringBase& second) const { - return first.compare(second); +template < > +struct compare < ::string::StringBase > { + int operator ()( const::string::StringBase & first, const::string::StringBase & second ) const { + return first.compare ( second ); } + }; } /* namespace std */ #endif /* STRING_BASE_H_ */ -