| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BIN_DARTUTILS_H_ | 5 #ifndef BIN_DARTUTILS_H_ |
| 6 #define BIN_DARTUTILS_H_ | 6 #define BIN_DARTUTILS_H_ |
| 7 | 7 |
| 8 #include "bin/builtin.h" | 8 #include "bin/builtin.h" |
| 9 #include "bin/utils.h" | 9 #include "bin/utils.h" |
| 10 #include "include/dart_api.h" | 10 #include "include/dart_api.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 static Dart_CObject* NewDouble(double value); | 156 static Dart_CObject* NewDouble(double value); |
| 157 static Dart_CObject* NewString(int length); | 157 static Dart_CObject* NewString(int length); |
| 158 static Dart_CObject* NewString(const char* str); | 158 static Dart_CObject* NewString(const char* str); |
| 159 static Dart_CObject* NewArray(int length); | 159 static Dart_CObject* NewArray(int length); |
| 160 static Dart_CObject* NewByteArray(int length); | 160 static Dart_CObject* NewByteArray(int length); |
| 161 | 161 |
| 162 Dart_CObject* AsApiCObject() { return cobject_; } | 162 Dart_CObject* AsApiCObject() { return cobject_; } |
| 163 | 163 |
| 164 // Create a new CObject array with an illegal arguments error. | 164 // Create a new CObject array with an illegal arguments error. |
| 165 static CObject* IllegalArgumentError(); | 165 static CObject* IllegalArgumentError(); |
| 166 // Create a new CObject array with a file closed error. |
| 167 static CObject* FileClosedError(); |
| 166 // Create a new CObject array with the current OS error. | 168 // Create a new CObject array with the current OS error. |
| 167 static CObject* NewOSError(); | 169 static CObject* NewOSError(); |
| 168 // Create a new CObject array with the specified OS error. | 170 // Create a new CObject array with the specified OS error. |
| 169 static CObject* NewOSError(OSError* os_error); | 171 static CObject* NewOSError(OSError* os_error); |
| 170 | 172 |
| 171 protected: | 173 protected: |
| 172 CObject() : cobject_(NULL) {} | 174 CObject() : cobject_(NULL) {} |
| 173 Dart_CObject* cobject_; | 175 Dart_CObject* cobject_; |
| 174 | 176 |
| 175 private: | 177 private: |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 | 288 |
| 287 class CObjectByteArray : public CObject { | 289 class CObjectByteArray : public CObject { |
| 288 public: | 290 public: |
| 289 DECLARE_COBJECT_CONSTRUCTORS(ByteArray) | 291 DECLARE_COBJECT_CONSTRUCTORS(ByteArray) |
| 290 | 292 |
| 291 int Length() const { return cobject_->value.as_byte_array.length; } | 293 int Length() const { return cobject_->value.as_byte_array.length; } |
| 292 uint8_t* Buffer() const { return cobject_->value.as_byte_array.values; } | 294 uint8_t* Buffer() const { return cobject_->value.as_byte_array.values; } |
| 293 }; | 295 }; |
| 294 | 296 |
| 295 #endif // BIN_DARTUTILS_H_ | 297 #endif // BIN_DARTUTILS_H_ |
| OLD | NEW |