File tree 1 file changed +12
-4
lines changed
1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,18 @@ class ARROW_EXPORT Status {
138
138
// Get the POSIX code associated with this Status, or -1 if there is none.
139
139
int16_t posix_code () const ;
140
140
141
+ StatusCode code () const {
142
+ return ((state_ == NULL ) ? StatusCode::OK : static_cast <StatusCode>(state_[4 ]));
143
+ }
144
+
145
+ std::string message () const {
146
+ uint32_t length;
147
+ memcpy (&length, state_, sizeof (length));
148
+ std::string msg;
149
+ msg.append ((state_ + 7 ), length);
150
+ return msg;
151
+ }
152
+
141
153
private:
142
154
// OK status has a NULL state_. Otherwise, state_ is a new[] array
143
155
// of the following form:
@@ -147,10 +159,6 @@ class ARROW_EXPORT Status {
147
159
// state_[7..] == message
148
160
const char * state_;
149
161
150
- StatusCode code () const {
151
- return ((state_ == NULL ) ? StatusCode::OK : static_cast <StatusCode>(state_[4 ]));
152
- }
153
-
154
162
Status (StatusCode code, const std::string& msg, int16_t posix_code);
155
163
static const char * CopyState (const char * s);
156
164
};
You can’t perform that action at this time.
0 commit comments