home *** CD-ROM | disk | FTP | other *** search
/ PC World 2002 July & August / PCWorld_2002-07-08_cd.bin / Software / Topware / hackman / _SETUP.1 / LPack.h < prev    next >
C/C++ Source or Header  |  2000-06-29  |  1KB  |  81 lines

  1. /**********************************************************************************************
  2.  *Language Pack Support*
  3.  ***********************
  4.  *
  5.  *    New for DLL Deity ▀6.0
  6.  *
  7.  *
  8.  ***********************************************************************************************/
  9. #ifndef _LPACK_H
  10. #define _LPACK_H
  11.  
  12. #include "ole2.h"
  13. #include "verinfo.h"
  14. #include "ltables.h"
  15.  
  16.  
  17. struct SLANGPDATA
  18. {
  19.     int    numwords;
  20.     LPSTR    words[numentries];
  21.     LPSTR    language;
  22.     LPSTR    author;
  23.  
  24.     SLANGPDATA()
  25.     {
  26.     }
  27.     
  28.     SLANGPDATA(LPSTR w[],int n) :    numwords(n),language(w[0]), author(w[1])
  29.     {int i;
  30.         for(i=0;i<n;i++)
  31.             words[i]=w[i];
  32.     }
  33.  
  34.     ~SLANGPDATA()
  35.     {
  36.     }
  37. };
  38.  
  39. class CLANGUAGEPACK
  40. {
  41.     private:
  42.             SVERSIONS    HM;
  43.             SLANGPDATA    myLangPack;
  44.     public:
  45.             CLANGUAGEPACK();
  46.             CLANGUAGEPACK(LPSTR [],int);
  47.             ~CLANGUAGEPACK();
  48.             SLANGPDATA*    GetPackData();
  49.             LPSTR Translate(LPSTR);
  50. };
  51.  
  52. CLANGUAGEPACK::CLANGUAGEPACK()
  53. {
  54. }
  55.  
  56. CLANGUAGEPACK::CLANGUAGEPACK(LPSTR w[],int sz) : myLangPack(w,sz)
  57. {
  58. }
  59.  
  60. CLANGUAGEPACK::~CLANGUAGEPACK()
  61. {
  62. }
  63.  
  64. SLANGPDATA* CLANGUAGEPACK::GetPackData()
  65. {
  66.     return &myLangPack;
  67. }
  68.  
  69. LPSTR CLANGUAGEPACK::Translate(LPSTR myWord)
  70. {int i;
  71.     for(i=0;i<myLangPack.numwords;i++)
  72.     {
  73.         if(!strcmp(myWord,deflang[i]))
  74.         {
  75.             return myLangPack.words[i];
  76.         }
  77.     }
  78. return NULL;
  79. }
  80.  
  81. #endif