diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-01-06 20:21:23 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-01-09 13:28:37 +0000 |
commit | 00e52e1e2d9e131df5634c085e176819a18330c7 (patch) | |
tree | a5d5b39d386ad8f58ac100dd144693262060faf2 /unotools | |
parent | 66c3510ed3344e7e87564c3de39cf5531e688c6e (diff) |
make indent sane
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/inc/unotools/charclass.hxx | 185 |
1 files changed, 100 insertions, 85 deletions
diff --git a/unotools/inc/unotools/charclass.hxx b/unotools/inc/unotools/charclass.hxx index da9be2a5a7df..e7253f6c397d 100644 --- a/unotools/inc/unotools/charclass.hxx +++ b/unotools/inc/unotools/charclass.hxx @@ -84,103 +84,106 @@ class UNOTOOLS_DLLPUBLIC CharClass : private boost::noncopyable public: /// Preferred ctor with service manager specified - CharClass( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xSF, - const ::com::sun::star::lang::Locale& rLocale - ); + CharClass( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xSF, + const ::com::sun::star::lang::Locale& rLocale); /// Depricated ctor, tries to get a process service manager or to load the /// library directly. - CharClass( - const ::com::sun::star::lang::Locale& rLocale - ); + CharClass(const ::com::sun::star::lang::Locale& rLocale); - ~CharClass(); + ~CharClass(); /// set a new Locale - void setLocale( const ::com::sun::star::lang::Locale& rLocale ); + void setLocale( const ::com::sun::star::lang::Locale& rLocale ); /// get current Locale const ::com::sun::star::lang::Locale& getLocale() const; /// isdigit() on ascii values - static inline sal_Bool isAsciiDigit( sal_Unicode c ) - { return c < 128 ? sal_Bool(isdigit( (unsigned char) c ) != 0) : sal_False; } + static inline sal_Bool isAsciiDigit( sal_Unicode c ) + { + return c < 128 ? sal_Bool(isdigit( (unsigned char) c ) != 0) : sal_False; + } /// isalpha() on ascii values - static inline sal_Bool isAsciiAlpha( sal_Unicode c ) - { return c < 128 ? sal_Bool(isalpha( (unsigned char) c ) != 0) : sal_False; } + static inline sal_Bool isAsciiAlpha( sal_Unicode c ) + { + return c < 128 ? sal_Bool(isalpha( (unsigned char) c ) != 0) : sal_False; + } /// isalnum() on ascii values - static inline sal_Bool isAsciiAlphaNumeric( sal_Unicode c ) - { return c < 128 ? sal_Bool(isalnum( (unsigned char) c ) != 0) : sal_False; } + static inline sal_Bool isAsciiAlphaNumeric( sal_Unicode c ) + { + return c < 128 ? sal_Bool(isalnum( (unsigned char) c ) != 0) : sal_False; + } /// isdigit() on ascii values of entire string - static sal_Bool isAsciiNumeric( const String& rStr ); + static sal_Bool isAsciiNumeric( const String& rStr ); /// isalpha() on ascii values of entire string - static sal_Bool isAsciiAlpha( const String& rStr ); + static sal_Bool isAsciiAlpha( const String& rStr ); /// isalnum() on ascii values of entire string - static sal_Bool isAsciiAlphaNumeric( const String& rStr ); + static sal_Bool isAsciiAlphaNumeric( const String& rStr ); /// whether type is pure alpha or not, e.g. return of getStringType - static inline sal_Bool isAlphaType( sal_Int32 nType ) - { - return ((nType & nCharClassAlphaType) != 0) && - ((nType & ~(nCharClassAlphaTypeMask)) == 0); - } + static inline sal_Bool isAlphaType( sal_Int32 nType ) + { + return ((nType & nCharClassAlphaType) != 0) && + ((nType & ~(nCharClassAlphaTypeMask)) == 0); + } /// whether type is pure numeric or not, e.g. return of getStringType - static inline sal_Bool isNumericType( sal_Int32 nType ) - { - return ((nType & nCharClassNumericType) != 0) && - ((nType & ~(nCharClassNumericTypeMask)) == 0); - } + static inline sal_Bool isNumericType( sal_Int32 nType ) + { + return ((nType & nCharClassNumericType) != 0) && + ((nType & ~(nCharClassNumericTypeMask)) == 0); + } /// whether type is pure alphanumeric or not, e.g. return of getStringType - static inline sal_Bool isAlphaNumericType( sal_Int32 nType ) - { - return ((nType & (nCharClassAlphaType | - nCharClassNumericType)) != 0) && - ((nType & ~(nCharClassAlphaTypeMask | - nCharClassNumericTypeMask)) == 0); - } + static inline sal_Bool isAlphaNumericType( sal_Int32 nType ) + { + return ((nType & (nCharClassAlphaType | + nCharClassNumericType)) != 0) && + ((nType & ~(nCharClassAlphaTypeMask | + nCharClassNumericTypeMask)) == 0); + } /// whether type is pure letter or not, e.g. return of getStringType - static inline sal_Bool isLetterType( sal_Int32 nType ) - { - return ((nType & nCharClassLetterType) != 0) && - ((nType & ~(nCharClassLetterTypeMask)) == 0); - } + static inline sal_Bool isLetterType( sal_Int32 nType ) + { + return ((nType & nCharClassLetterType) != 0) && + ((nType & ~(nCharClassLetterTypeMask)) == 0); + } /// whether type is pure letternumeric or not, e.g. return of getStringType - static inline sal_Bool isLetterNumericType( sal_Int32 nType ) - { - return ((nType & (nCharClassLetterType | - nCharClassNumericType)) != 0) && - ((nType & ~(nCharClassLetterTypeMask | - nCharClassNumericTypeMask)) == 0); - } + static inline sal_Bool isLetterNumericType( sal_Int32 nType ) + { + return ((nType & (nCharClassLetterType | + nCharClassNumericType)) != 0) && + ((nType & ~(nCharClassLetterTypeMask | + nCharClassNumericTypeMask)) == 0); + } // Wrapper implementations of class CharacterClassification - String toUpper( const String& rStr, xub_StrLen nPos, xub_StrLen nCount ) const; - String toLower( const String& rStr, xub_StrLen nPos, xub_StrLen nCount ) const; - String toTitle( const String& rStr, xub_StrLen nPos, xub_StrLen nCount ) const; + String toUpper( const String& rStr, xub_StrLen nPos, xub_StrLen nCount ) const; + String toLower( const String& rStr, xub_StrLen nPos, xub_StrLen nCount ) const; + String toTitle( const String& rStr, xub_StrLen nPos, xub_StrLen nCount ) const; - ::rtl::OUString toUpper_rtl( const ::rtl::OUString& rStr, sal_Int32 nPos, sal_Int32 nCount ) const; - ::rtl::OUString toLower_rtl( const ::rtl::OUString& rStr, sal_Int32 nPos, sal_Int32 nCount ) const; - // use the postfix because compilers could get confused by the both similar versions - // (me thinks they shouldn't, but in fact MSCV 6 does) + ::rtl::OUString toUpper_rtl( const ::rtl::OUString& rStr, sal_Int32 nPos, sal_Int32 nCount ) const; + ::rtl::OUString toLower_rtl( const ::rtl::OUString& rStr, sal_Int32 nPos, sal_Int32 nCount ) const; + // use the postfix because compilers could get confused by the both similar versions + // (me thinks they shouldn't, but in fact MSCV 6 does) - sal_Int16 getType( const String& rStr, xub_StrLen nPos ) const; - sal_Int16 getCharacterDirection( const String& rStr, xub_StrLen nPos ) const; - sal_Int16 getScript( const String& rStr, xub_StrLen nPos ) const; - sal_Int32 getCharacterType( const String& rStr, xub_StrLen nPos ) const; - sal_Int32 getStringType( const String& rStr, xub_StrLen nPos, xub_StrLen nCount ) const; + sal_Int16 getType( const String& rStr, xub_StrLen nPos ) const; + sal_Int16 getCharacterDirection( const String& rStr, xub_StrLen nPos ) const; + sal_Int16 getScript( const String& rStr, xub_StrLen nPos ) const; + sal_Int32 getCharacterType( const String& rStr, xub_StrLen nPos ) const; + sal_Int32 getStringType( const String& rStr, xub_StrLen nPos, xub_StrLen nCount ) const; ::com::sun::star::i18n::ParseResult parseAnyToken( const String& rStr, @@ -202,33 +205,45 @@ public: // Functionality of class International methods - sal_Bool isAlpha( const String& rStr, xub_StrLen nPos ) const; - sal_Bool isLetter( const String& rStr, xub_StrLen nPos ) const; - sal_Bool isDigit( const String& rStr, xub_StrLen nPos ) const; - sal_Bool isAlphaNumeric( const String& rStr, xub_StrLen nPos ) const; - sal_Bool isLetterNumeric( const String& rStr, xub_StrLen nPos ) const; - sal_Bool isAlpha( const String& rStr ) const; - sal_Bool isLetter( const String& rStr ) const; - sal_Bool isNumeric( const String& rStr ) const; - sal_Bool isAlphaNumeric( const String& rStr ) const; - sal_Bool isLetterNumeric( const String& rStr ) const; - - void toUpper( rtl::OUString& rStr ) const; - void toUpper( String& rStr ) const - { rStr = toUpper( rStr, 0, rStr.Len() ); } - void toLower( rtl::OUString& rStr ) const; - void toLower( String& rStr ) const - { rStr = toLower( rStr, 0, rStr.Len() ); } - inline String upper( const String& rStr ) const - { return toUpper( rStr, 0, rStr.Len() ); } - inline String lower( const String& rStr ) const - { return toLower( rStr, 0, rStr.Len() ); } - - const ::rtl::OUString& toUpper_rtl( ::rtl::OUString& _rStr ) const { return _rStr = toUpper_rtl( _rStr, 0, _rStr.getLength() ); } - const ::rtl::OUString& toLower_rtl( ::rtl::OUString& _rStr ) const { return _rStr = toLower_rtl( _rStr, 0, _rStr.getLength() ); } -}; - + sal_Bool isAlpha( const String& rStr, xub_StrLen nPos ) const; + sal_Bool isLetter( const String& rStr, xub_StrLen nPos ) const; + sal_Bool isDigit( const String& rStr, xub_StrLen nPos ) const; + sal_Bool isAlphaNumeric( const String& rStr, xub_StrLen nPos ) const; + sal_Bool isLetterNumeric( const String& rStr, xub_StrLen nPos ) const; + sal_Bool isAlpha( const String& rStr ) const; + sal_Bool isLetter( const String& rStr ) const; + sal_Bool isNumeric( const String& rStr ) const; + sal_Bool isAlphaNumeric( const String& rStr ) const; + sal_Bool isLetterNumeric( const String& rStr ) const; + + void toUpper( rtl::OUString& rStr ) const; + void toUpper( String& rStr ) const + { + rStr = toUpper( rStr, 0, rStr.Len() ); + } + void toLower( rtl::OUString& rStr ) const; + void toLower( String& rStr ) const + { + rStr = toLower( rStr, 0, rStr.Len() ); + } + inline String upper( const String& rStr ) const + { + return toUpper( rStr, 0, rStr.Len() ); + } + inline String lower( const String& rStr ) const + { + return toLower( rStr, 0, rStr.Len() ); + } + const ::rtl::OUString& toUpper_rtl( ::rtl::OUString& _rStr ) const + { + return _rStr = toUpper_rtl( _rStr, 0, _rStr.getLength() ); + } + const ::rtl::OUString& toLower_rtl( ::rtl::OUString& _rStr ) const + { + return _rStr = toLower_rtl( _rStr, 0, _rStr.getLength() ); + } +}; #endif // _UNOTOOLS_CHARCLASS_HXX |