Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Side by Side Diff: runtime/bin/utils.h

Issue 9630012: Error reporting on File in dart:io (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Style issues Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/io_sources.gypi ('k') | runtime/bin/utils_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 #include <stdlib.h>
9 #include <string.h>
10
11 #include "include/dart_api.h"
12 #include "platform/globals.h"
13
14 class OSError {
15 public:
16 OSError();
17 OSError(int code, char* message) {
18 code_ = code;
19 SetMessage(message);
20 }
21 virtual ~OSError() { free(message_); }
22
23 int code() { return code_; }
24 void set_code(int code) { code_ = code; }
25 char* message() { return message_; }
26 void SetMessage(char* message) {
27 free(message_);
28 if (message == NULL) {
29 message_ = NULL;
30 } else {
31 message_ = strdup(message);
32 }
33 }
34
35 private:
36 int code_;
37 char* message_;
38
39 DISALLOW_COPY_AND_ASSIGN(OSError);
40 };
41
42 #endif // BIN_UTILS_H_
OLDNEW
« no previous file with comments | « runtime/bin/io_sources.gypi ('k') | runtime/bin/utils_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698