OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
2 // for details. All rights reserved. Use of this source code is governed by a | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 #ifndef BIN_UTILS_H_ | |
6 #define BIN_UTILS_H_ | |
7 | |
8 class OSError { | |
9 public: | |
10 OSError() : code_(0), message_(NULL) {} | |
11 virtual ~OSError() { free(message_); } | |
12 | |
13 int code() { return code_; } | |
14 void set_code(int code) { code_ = code; } | |
15 char* message() { return message_; } | |
16 void SetMessage(char* message) { message_ = strdup(message); } | |
Mads Ager (google)
2012/03/09 09:40:13
Let's add an ASSERT(message_ == NULL) here to guar
Søren Gjesse
2012/03/13 08:25:55
Added freeing of message_ instead.
| |
17 | |
18 private: | |
19 int code_; | |
20 char* message_; | |
21 | |
22 DISALLOW_COPY_AND_ASSIGN(OSError); | |
23 }; | |
24 | |
25 | |
26 #endif // BIN_UTILS_H_ | |
OLD | NEW |