X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftrans.h;h=a056e1233a42760589321b4fe2463dcec569d5d7;hb=7cb3b054916d146ccf5b57d15351b448775af26a;hp=839caa462cc256b8aa65f1eb236826bfc079f9b3;hpb=dfe1bc44b44903faf77ef454c98c4c3e56c1d5e3;p=lyx.git diff --git a/src/trans.h b/src/trans.h index 839caa462c..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 string 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 string 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(string const &language); + int Load(string const & language); /// - bool IsDefined(); + bool IsDefined() const; /// - const string& GetName(); + string const & GetName() const; /// - string process(char,TransManager&); + string const process(char, TransManager &); /// - bool isAccentDefined(tex_accent,KmodInfo&); + bool isAccentDefined(tex_accent, KmodInfo &) const; private: /// @@ -71,31 +71,32 @@ private: typedef KmodException keyexc; /// - void AddDeadkey(tex_accent, const string&, const string&); + 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 string& 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); /// 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_[c]; }