Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 INCLUDE_DART_API_H_ | 5 #ifndef INCLUDE_DART_API_H_ |
| 6 #define INCLUDE_DART_API_H_ | 6 #define INCLUDE_DART_API_H_ |
| 7 | 7 |
| 8 /** \mainpage Dart Embedding API Reference | 8 /** \mainpage Dart Embedding API Reference |
| 9 * | 9 * |
| 10 * Dart is a class-based programming language for creating structured | 10 * Dart is a class-based programming language for creating structured |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 720 DART_EXPORT bool Dart_IsString(Dart_Handle object); | 720 DART_EXPORT bool Dart_IsString(Dart_Handle object); |
| 721 | 721 |
| 722 /** | 722 /** |
| 723 * Is this object a String whose codepoints all fit into 8 bits? | 723 * Is this object a String whose codepoints all fit into 8 bits? |
| 724 */ | 724 */ |
| 725 DART_EXPORT bool Dart_IsString8(Dart_Handle object); | 725 DART_EXPORT bool Dart_IsString8(Dart_Handle object); |
| 726 | 726 |
| 727 /** | 727 /** |
| 728 * Is this object a String whose codepoints all fit into 16 bits? | 728 * Is this object a String whose codepoints all fit into 16 bits? |
| 729 */ | 729 */ |
| 730 DART_EXPORT bool Dart_IsString16(Dart_Handle object); | 730 DART_EXPORT bool Dart_IsString16(Dart_Handle object); |
|
siva
2011/12/02 01:53:01
to make the API uniform maybe we need a Dart_IsStr
turnidge
2011/12/05 17:54:28
I wondered the same thing. When I looked at the c
| |
| 731 | 731 |
| 732 /** | 732 /** |
| 733 * Gets the length of a String. | 733 * Gets the length of a String. |
| 734 * | 734 * |
| 735 * \param str A String. | 735 * \param str A String. |
| 736 * \param length Returns the length of the String. | 736 * \param length Returns the length of the String. |
| 737 * | 737 * |
| 738 * \return A valid handle if no error occurs during the operation. | 738 * \return A valid handle if no error occurs during the operation. |
| 739 */ | 739 */ |
| 740 DART_EXPORT Dart_Handle Dart_StringLength(Dart_Handle str, intptr_t* length); | 740 DART_EXPORT Dart_Handle Dart_StringLength(Dart_Handle str, intptr_t* length); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 781 * | 781 * |
| 782 * \return The String object if no error occurs. Otherwise returns | 782 * \return The String object if no error occurs. Otherwise returns |
| 783 * an error handle. | 783 * an error handle. |
| 784 */ | 784 */ |
| 785 DART_EXPORT Dart_Handle Dart_NewString32(const uint32_t* codepoints, | 785 DART_EXPORT Dart_Handle Dart_NewString32(const uint32_t* codepoints, |
| 786 intptr_t length); | 786 intptr_t length); |
| 787 | 787 |
| 788 | 788 |
| 789 typedef void (*Dart_PeerFinalizer)(void* peer); | 789 typedef void (*Dart_PeerFinalizer)(void* peer); |
| 790 | 790 |
| 791 /** | |
| 792 * Is this object an external String? | |
| 793 * | |
| 794 * An external String is a String which references a fixed array of | |
| 795 * codepoints which is external to the Dart heap. | |
| 796 */ | |
| 797 DART_EXPORT bool Dart_IsExternalString(Dart_Handle object); | |
| 798 | |
| 799 /** | |
| 800 * Retrieves the peer pointer associated with an external String. | |
| 801 */ | |
| 802 DART_EXPORT Dart_Handle Dart_ExternalStringGetPeer(Dart_Handle object, | |
| 803 void** peer); | |
| 804 | |
| 805 | |
| 806 /** | |
| 807 * Returns a String which references an external array of 8-bit codepoints. | |
| 808 * | |
| 809 * \param value An array of 8-bit codepoints. This array must not move. | |
| 810 * \param length The length of the codepoints array. | |
| 811 * \param peer An external pointer to associate with this string. | |
| 812 * \param callback A callback to be called when this string is finalized. | |
| 813 * | |
| 814 * \return The String object if no error occurs. Otherwise returns | |
| 815 * an error handle. | |
| 816 */ | |
| 791 DART_EXPORT Dart_Handle Dart_NewExternalString8(const uint8_t* codepoints, | 817 DART_EXPORT Dart_Handle Dart_NewExternalString8(const uint8_t* codepoints, |
| 792 intptr_t length, | 818 intptr_t length, |
| 793 void* peer, | 819 void* peer, |
| 794 Dart_PeerFinalizer callback); | 820 Dart_PeerFinalizer callback); |
| 795 | 821 |
| 822 /** | |
| 823 * Returns a String which references an external array of 16-bit codepoints. | |
| 824 * | |
| 825 * \param value An array of 16-bit codepoints. This array must not move. | |
| 826 * \param length The length of the codepoints array. | |
| 827 * \param peer An external pointer to associate with this string. | |
| 828 * \param callback A callback to be called when this string is finalized. | |
| 829 * | |
| 830 * \return The String object if no error occurs. Otherwise returns | |
| 831 * an error handle. | |
| 832 */ | |
| 796 DART_EXPORT Dart_Handle Dart_NewExternalString16(const uint16_t* codepoints, | 833 DART_EXPORT Dart_Handle Dart_NewExternalString16(const uint16_t* codepoints, |
| 797 intptr_t length, | 834 intptr_t length, |
| 798 void* peer, | 835 void* peer, |
| 799 Dart_PeerFinalizer callback); | 836 Dart_PeerFinalizer callback); |
| 800 | 837 |
| 838 /** | |
| 839 * Returns a String which references an external array of 32-bit codepoints. | |
| 840 * | |
| 841 * \param value An array of 32-bit codepoints. This array must not move. | |
| 842 * \param length The length of the codepoints array. | |
| 843 * \param peer An external pointer to associate with this string. | |
| 844 * \param callback A callback to be called when this string is finalized. | |
| 845 * | |
| 846 * \return The String object if no error occurs. Otherwise returns | |
| 847 * an error handle. | |
| 848 */ | |
| 801 DART_EXPORT Dart_Handle Dart_NewExternalString32(const uint32_t* codepoints, | 849 DART_EXPORT Dart_Handle Dart_NewExternalString32(const uint32_t* codepoints, |
| 802 intptr_t length, | 850 intptr_t length, |
| 803 void* peer, | 851 void* peer, |
| 804 Dart_PeerFinalizer callback); | 852 Dart_PeerFinalizer callback); |
| 805 | 853 |
| 806 /** | 854 /** |
| 807 * Gets the codepoints from a String. | 855 * Gets the codepoints from a String. |
| 808 * | 856 * |
| 809 * This function is only valid on strings for which Dart_IsString8 is | 857 * This function is only valid on strings for which Dart_IsString8 is |
| 810 * true. Otherwise an error occurs. | 858 * true. Otherwise an error occurs. |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1227 | 1275 |
| 1228 // --- Profiling support ---- | 1276 // --- Profiling support ---- |
| 1229 | 1277 |
| 1230 // External pprof support for gathering and dumping symbolic | 1278 // External pprof support for gathering and dumping symbolic |
| 1231 // information that can be used for better profile reports for | 1279 // information that can be used for better profile reports for |
| 1232 // dynamically generated code. | 1280 // dynamically generated code. |
| 1233 DART_EXPORT void Dart_InitPprofSupport(); | 1281 DART_EXPORT void Dart_InitPprofSupport(); |
| 1234 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); | 1282 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); |
| 1235 | 1283 |
| 1236 #endif // INCLUDE_DART_API_H_ | 1284 #endif // INCLUDE_DART_API_H_ |
| OLD | NEW |