F´ Flight Software - C/C++ Documentation  devel
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 "FpConfig.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,
54  };
55 
57  typedef T t;
58 
59  public:
60 
61  // ----------------------------------------------------------------------
62  // Constants
63  // ----------------------------------------------------------------------
64 
65  enum {
70  };
71 
72  public:
73 
74  // ----------------------------------------------------------------------
75  // Constructors
76  // ----------------------------------------------------------------------
77 
80  {
81  this->e = OP_OK;
82  }
83 
86  const T e1
87  )
88  {
89  this->e = e1;
90  }
91 
94  const FileStatus& obj
95  )
96  {
97  this->e = obj.e;
98  }
99 
100  public:
101 
102  // ----------------------------------------------------------------------
103  // Operators
104  // ----------------------------------------------------------------------
105 
108  const FileStatus& obj
109  );
110 
113  T e1
114  );
115 
117  operator T() const
118  {
119  return this->e;
120  }
121 
123  bool operator==(T e1) const
124  {
125  return this->e == e1;
126  }
127 
129  bool operator!=(T e1) const
130  {
131  return !(*this == e1);
132  }
133 
134 #ifdef BUILD_UT
135 
137  friend std::ostream& operator<<(
138  std::ostream& os,
139  const FileStatus& obj
140  );
141 
142 #endif
143 
144  public:
145 
146  // ----------------------------------------------------------------------
147  // Member functions
148  // ----------------------------------------------------------------------
149 
151  bool isValid() const;
152 
155  Fw::SerializeBufferBase& buffer
156  ) const;
157 
160  Fw::SerializeBufferBase& buffer
161  );
162 
163 #if FW_SERIALIZABLE_TO_STRING
164 
166  void toString(
167  Fw::StringBase& sb
168  ) const;
169 
170 #endif
171 
172  public:
173 
174  // ----------------------------------------------------------------------
175  // Member variables
176  // ----------------------------------------------------------------------
177 
179  T e;
180 
181  };
182 
183 }
184 
185 #endif
C++-compatible configuration header for fprime configuration.
forward declaration
FPP shadow-enum representing Os::File::Status.
bool operator==(T e1) const
Equality operator.
I32 SerialType
The serial representation type.
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)
Deserialize raw enum value from SerialType.
bool operator!=(T e1) const
Inequality operator.
T e
The raw enum value.
FileStatus & operator=(const FileStatus &obj)
Copy assignment operator (object)
T
The raw enum type.
@ NOT_SUPPORTED
Kernel or file system does not support operation.
@ INVALID_ARGUMENT
Invalid argument passed in.
@ NOT_OPENED
file hasn't been opened yet
@ BAD_SIZE
Invalid size parameter.
@ OTHER_ERROR
A catch-all for other errors. Have to look in implementation-specific code.
@ FILE_EXISTS
file already exist (for CREATE with O_EXCL enabled)
@ NO_PERMISSION
No permission to read/write file.
@ NO_SPACE
No space left.
@ DOESNT_EXIST
File doesn't exist (for read)
@ INVALID_MODE
Mode for file access is invalid for current operation.
@ OP_OK
Operation was successful.
Fw::SerializeStatus serialize(Fw::SerializeBufferBase &buffer) const
Serialize raw enum value to SerialType.
T t
For backwards compatibility.
bool isValid() const
Check raw enum value for validity.
FileStatus()
Constructor (default value of OP_OK)
@ SERIALIZED_SIZE
The size of the serial representation.
@ NUM_CONSTANTS
The number of enumerated constants.
FileStatus(const FileStatus &obj)
Copy constructor.
FileStatus(const T e1)
Constructor (user-provided value)
SerializeStatus
forward declaration for string