FAST.Framework  1.0.0
FChar.h
1 /******************************************************************************
2 **
3 ** FAST.Framework
4 **
5 ** Created: 2020.08.29
6 ** Author: Boris Fast
7 ** Mail: Support@FAST-Framework.com
8 **
9 ******************************************************************************/
10 
11 #ifndef FCHAR_H
12 #define FCHAR_H
13 
14 using namespace std;
15 
16 #include "FObject.h"
17 
21 class FChar : public FObject
22 {
23  public:
24  FChar(const FChar& fChar) { this->buffer = fChar.buffer; }
25  FChar(char character) { this->buffer = character; }
26  FChar() { this->buffer = '\0'; }
27  virtual ~FChar() = default;
28 
29  inline void Clear() { this->buffer = '\0'; }
30  inline Boolean IsEmpty() const { return this->buffer == '\0'; }
31  inline void operator =(const char& character)
32  {
33  this->buffer = character;
34  }
35  inline Boolean operator ==(const FChar& fChar) const
36  {
37  return this->buffer == fChar.buffer;
38  }
39  inline Boolean operator ==(const char& character) const
40  {
41  return this->buffer == character;
42  }
43 
44  FChar ToLower() const;
45  FChar ToUpper() const;
46 
47  Boolean IsAlnum() const;
48  Boolean IsAlpha() const;
49  Boolean IsCntrl() const;
50  Boolean IsDigit() const;
51  Boolean IsGraph() const;
52  Boolean IsLower() const;
53  Boolean IsPrint() const;
54  Boolean IsPunct() const;
55  Boolean IsSpace() const;
56  Boolean IsUpper() const;
57  Boolean IsXDigit() const;
58 
59  inline char Data() const { return this->buffer; }
60 
61  static Boolean IsAlnum(const char& character);
62  static Boolean IsAlpha(const char& character);
63  static Boolean IsCntrl(const char& character);
64  static Boolean IsDigit(const char& character);
65  static Boolean IsGraph(const char& character);
66  static Boolean IsLower(const char& character);
67  static Boolean IsPrint(const char& character);
68  static Boolean IsPunct(const char& character);
69  static Boolean IsSpace(const char& character);
70  static Boolean IsUpper(const char& character);
71  static Boolean IsXDigit(const char& character);
72  static Boolean IsEmpty(const char& character);
73 
74  static constexpr char MinValue = SCHAR_MIN;
75  static constexpr char MaxValue = SCHAR_MAX;
76  static constexpr unsigned char MaxUValue = UCHAR_MAX;
77 
78  const type_info& GetType() override;
79  FString GetName() const override;
80 
81  private:
82  char buffer;
83 };
84 
85 #endif // FCHAR_H
FString
Definition: FString.h:21
FChar
Definition: FChar.h:21
FObject
Definition: FObject.h:49