X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftrans.h;h=a056e1233a42760589321b4fe2463dcec569d5d7;hb=7cb3b054916d146ccf5b57d15351b448775af26a;hp=929cd7fc008c447771213f8ec9a61da73c3243c9;hpb=27de1486ca34aaad446adb798d71a77d6f6304da;p=lyx.git diff --git a/src/trans.h b/src/trans.h index 929cd7fc00..a056e1233a 100644 --- a/src/trans.h +++ b/src/trans.h @@ -1,6 +1,6 @@ // -*- C++ -*- -#ifndef _Trans_h_ -#define _Trans_h_ +#ifndef Trans_h +#define Trans_h #ifdef __GNUG__ #pragma interface @@ -22,31 +22,31 @@ class TransManager; class TransInterface { public: /// - virtual LString process(char,TransManager&)=0; + virtual string const process(char, TransManager &) = 0; /// - virtual bool isAccentDefined(tex_accent,KmodInfo&)=0; + virtual bool isAccentDefined(tex_accent, KmodInfo &) const = 0; }; /** - DefaultTrans: the default translation class. Hols info + DefaultTrans: the default translation class. Holds info on tex-accents. Monostate */ -class DefaultTrans: public TransInterface { -private: - /// - static bool init_; +class DefaultTrans : public TransInterface { public: /// DefaultTrans(); /// - virtual LString process(char,TransManager&); + virtual string const process(char, TransManager &); +private: + /// + static bool init_; }; /** Trans: holds a .kmap file */ -class Trans:public TransInterface { +class Trans : public TransInterface { public: /// Trans(); @@ -54,15 +54,15 @@ public: virtual ~Trans(); /// - int Load(LString const &language); + int Load(string const & language); /// - bool IsDefined(); + bool IsDefined() const; /// - const LString& GetName(); + string const & GetName() const; /// - LString process(char,TransManager&); + string const process(char, TransManager &); /// - bool isAccentDefined(tex_accent,KmodInfo&); + bool isAccentDefined(tex_accent, KmodInfo &) const; private: /// @@ -71,33 +71,34 @@ private: typedef KmodException keyexc; /// - void AddDeadkey(tex_accent, const LString&, const LString&); + void AddDeadkey(tex_accent, string const &, string const &); /// void FreeKeymap(); /// int Load(LyXLex &); /// - inline char* Match(char c); + inline string const & Match(unsigned char c); /// - void InsertException(keyexc &exclist, char c, - const LString& data, bool = false, + void InsertException(keyexc & exclist, char c, + string const & data, bool = false, tex_accent = TEX_NOACCENT); /// - void FreeException(keyexc& exclist); + void FreeException(keyexc & exclist); /// - LString name_; + string name_; /// - char *keymap_[256]; + string keymap_[256]; /// - kmod_list_decl *kmod_list_[TEX_MAX_ACCENT+1]; + kmod_list_decl * kmod_list_[TEX_MAX_ACCENT+1]; }; -char* Trans::Match(char c) +/// +string const & Trans::Match(unsigned char c) { - return keymap_[(unsigned char)c]; + return keymap_[c]; } #endif