OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 /** | 1017 /** |
1018 * Converts an object to a two-byte string. | 1018 * Converts an object to a two-byte string. |
1019 * If conversion to a string fails (eg. due to an exception in the toString() | 1019 * If conversion to a string fails (eg. due to an exception in the toString() |
1020 * method of the object) then the length() method returns 0 and the * operator | 1020 * method of the object) then the length() method returns 0 and the * operator |
1021 * returns NULL. | 1021 * returns NULL. |
1022 */ | 1022 */ |
1023 class V8EXPORT Value { | 1023 class V8EXPORT Value { |
1024 public: | 1024 public: |
1025 explicit Value(Handle<v8::Value> obj); | 1025 explicit Value(Handle<v8::Value> obj); |
1026 ~Value(); | 1026 ~Value(); |
1027 uint16_t* operator*() const { return str_; } | 1027 uint16_t* operator*() { return str_; } |
1028 const uint16_t* operator*() { return str_; } | 1028 const uint16_t* operator*() const { return str_; } |
1029 int length() const { return length_; } | 1029 int length() const { return length_; } |
1030 private: | 1030 private: |
1031 uint16_t* str_; | 1031 uint16_t* str_; |
1032 int length_; | 1032 int length_; |
1033 | 1033 |
1034 // Disallow copying and assigning. | 1034 // Disallow copying and assigning. |
1035 Value(const Value&); | 1035 Value(const Value&); |
1036 void operator=(const Value&); | 1036 void operator=(const Value&); |
1037 }; | 1037 }; |
1038 | 1038 |
(...skipping 2041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3080 | 3080 |
3081 } // namespace v8 | 3081 } // namespace v8 |
3082 | 3082 |
3083 | 3083 |
3084 #undef V8EXPORT | 3084 #undef V8EXPORT |
3085 #undef V8EXPORT_INLINE | 3085 #undef V8EXPORT_INLINE |
3086 #undef TYPE_CHECK | 3086 #undef TYPE_CHECK |
3087 | 3087 |
3088 | 3088 |
3089 #endif // V8_H_ | 3089 #endif // V8_H_ |
OLD | NEW |