Chromium Code Reviews| Index: runtime/bin/utils.h |
| diff --git a/runtime/bin/utils.h b/runtime/bin/utils.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0ae0fae3da0fa1d09bee4739fd7c867c207dfb22 |
| --- /dev/null |
| +++ b/runtime/bin/utils.h |
| @@ -0,0 +1,26 @@ |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +#ifndef BIN_UTILS_H_ |
| +#define BIN_UTILS_H_ |
| + |
| +class OSError { |
| + public: |
| + OSError() : code_(0), message_(NULL) {} |
| + virtual ~OSError() { free(message_); } |
| + |
| + int code() { return code_; } |
| + void set_code(int code) { code_ = code; } |
| + char* message() { return message_; } |
| + 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.
|
| + |
| + private: |
| + int code_; |
| + char* message_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(OSError); |
| +}; |
| + |
| + |
| +#endif // BIN_UTILS_H_ |