F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FileStatusEnumAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FileStatusEnumAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for FileStatus enum
5 // ======================================================================
6 
7 #ifndef Os_FileStatusEnumAc_HPP
8 #define Os_FileStatusEnumAc_HPP
9 
10 #include "Fw/FPrimeBasicTypes.hpp"
12 #include "Fw/Types/String.hpp"
13 
14 namespace Os {
15 
17  class FileStatus :
18  public Fw::Serializable
19  {
20 
21  public:
22 
23  // ----------------------------------------------------------------------
24  // Types
25  // ----------------------------------------------------------------------
26 
28  typedef I32 SerialType;
29 
31  enum T {
33  OP_OK = 0,
37  NO_SPACE = 2,
41  BAD_SIZE = 4,
56  };
57 
59  typedef T t;
60 
61  public:
62 
63  // ----------------------------------------------------------------------
64  // Constants
65  // ----------------------------------------------------------------------
66 
67  enum {
72  };
73 
74  public:
75 
76  // ----------------------------------------------------------------------
77  // Constructors
78  // ----------------------------------------------------------------------
79 
82  {
83  this->e = OP_OK;
84  }
85 
88  const T e1
89  )
90  {
91  this->e = e1;
92  }
93 
96  const FileStatus& obj
97  )
98  {
99  this->e = obj.e;
100  }
101 
102  public:
103 
104  // ----------------------------------------------------------------------
105  // Operators
106  // ----------------------------------------------------------------------
107 
110  const FileStatus& obj
111  );
112 
115  T e1
116  );
117 
119  operator T() const
120  {
121  return this->e;
122  }
123 
125  bool operator==(T e1) const
126  {
127  return this->e == e1;
128  }
129 
131  bool operator!=(T e1) const
132  {
133  return !(*this == e1);
134  }
135 
136 #ifdef BUILD_UT
137 
139  friend std::ostream& operator<<(
140  std::ostream& os,
141  const FileStatus& obj
142  );
143 
144 #endif
145 
146  public:
147 
148  // ----------------------------------------------------------------------
149  // Member functions
150  // ----------------------------------------------------------------------
151 
153  bool isValid() const;
154 
157  Fw::SerializeBufferBase& buffer
158  ) const;
159 
162  Fw::SerializeBufferBase& buffer
163  );
164 
165 #if FW_SERIALIZABLE_TO_STRING
166 
168  void toString(
169  Fw::StringBase& sb
170  ) const;
171 
172 #endif
173 
174  public:
175 
176  // ----------------------------------------------------------------------
177  // Member variables
178  // ----------------------------------------------------------------------
179 
181  T e;
182 
183  };
184 
185 }
186 
187 #endif
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)
Deserialize raw enum value from SerialType.
The number of enumerated constants.
FileStatus(const FileStatus &obj)
Copy constructor.
bool operator==(T e1) const
Equality operator.
FileStatus()
Constructor (default value of OP_OK)
bool isValid() const
Check raw enum value for validity.
file hasn&#39;t been opened yet
No permission to read/write file.
File doesn&#39;t exist (for read)
FileStatus & operator=(const FileStatus &obj)
Copy assignment operator (object)
SerializeStatus
forward declaration for string
file already exist (for CREATE with O_EXCL enabled)
No more available resources.
T
The raw enum type.
A catch-all for other errors. Have to look in implementation-specific code.
I32 SerialType
The serial representation type.
Kernel or file system does not support operation.
Fw::SerializeStatus serialize(Fw::SerializeBufferBase &buffer) const
Serialize raw enum value to SerialType.
bool operator!=(T e1) const
Inequality operator.
Mode for file access is invalid for current operation.
T e
The raw enum value.
forward declaration
FileStatus(const T e1)
Constructor (user-provided value)
Invalid argument passed in.
T t
For backwards compatibility.
FPP shadow-enum representing Os::File::Status.
Invalid size parameter.
Operation was successful.
The size of the serial representation.