home *** CD-ROM | disk | FTP | other *** search
/ Troubleshooting Netware Systems / CSTRIAL0196.BIN / attach / msj / v10n04 / multilin.exe / PICTURE.H < prev    next >
C/C++ Source or Header  |  1995-04-01  |  1KB  |  54 lines

  1. // picture.h : header file
  2. //
  3.  
  4. #define MAXSEP 8
  5. #define MAXPICT 128
  6. #define LOCALE_UNRESTRICTED 0L /* i.e. not NOUSEROVERRIDE */
  7.  
  8. #if _DEBUG
  9. void Test();
  10. #endif
  11.  
  12. class CPicture : public NUMBERFMT
  13. {
  14.     #if _DEBUG
  15.     friend void Test();
  16.     #endif
  17. public:
  18.     CPicture(LCID lcid=LOCALE_SYSTEM_DEFAULT, DWORD dwFlags =LOCALE_UNRESTRICTED);
  19.      CPicture(LPCTSTR lpInp,
  20.              LCID lcid=LOCALE_SYSTEM_DEFAULT,
  21.               DWORD dwFlags=LOCALE_UNRESTRICTED 
  22.               );
  23.      operator NUMBERFMT(){return *((NUMBERFMT *)this);}
  24.     operator LPCTSTR(){return m_Picture;  }
  25.     int m_Length;       // non-zer0 == success of constructor
  26.  
  27. private:
  28.     // Place for lpDecimalSep, etc. to point to
  29.     TCHAR m_DecSep[MAXSEP];
  30.     TCHAR m_ThouSep[MAXSEP];  
  31.     TCHAR m_Picture[MAXPICT];
  32.     
  33.     // Methods         
  34.     int BuildUp();
  35.  
  36.     // These could just as well be functions
  37.     void BuildUpPositive(int& count);
  38.     void GetFieldValue(LCTYPE lctype, UINT& uiVal);
  39.     void GetFieldValue(LCTYPE lctype, LPTSTR str);
  40.     void GetFieldValue(LCID lcid, LCTYPE lctype, UINT& uiVal);
  41.     void GetFieldValue(LCID lcid, LCTYPE lctype, LPTSTR str);
  42.  
  43.     int Parse(LPCTSTR lpInp);
  44.  
  45.     // These modify lpInp
  46.     int Sign(LPCTSTR& lpInp);
  47.     int AltSign(LPCTSTR& lpInp);
  48.     int ParSign(LPCTSTR& lpInp, int count);
  49.     int Integer(LPCTSTR& lpInp,TCHAR& chDigit);
  50.     int PosNum(LPCTSTR& lpInp,TCHAR chDigit);
  51.     int Fraction(LPCTSTR& lpInp,TCHAR chDigit);
  52. };
  53.  
  54.