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

Side by Side Diff: include/dart_api.h

Issue 11360114: - Add functionality to morph a string into an external string (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 1 month 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 | « no previous file | vm/dart_api_impl.cc » ('j') | vm/object.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 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 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after
1477 * the array of UTF-16 encoded characters. 1477 * the array of UTF-16 encoded characters.
1478 * \param length Used to pass in the length of the provided array. 1478 * \param length Used to pass in the length of the provided array.
1479 * Used to return the length of the array which was actually used. 1479 * Used to return the length of the array which was actually used.
1480 * 1480 *
1481 * \return A valid handle if no error occurs during the operation. 1481 * \return A valid handle if no error occurs during the operation.
1482 */ 1482 */
1483 DART_EXPORT Dart_Handle Dart_StringToUTF16(Dart_Handle str, 1483 DART_EXPORT Dart_Handle Dart_StringToUTF16(Dart_Handle str,
1484 uint16_t* utf16_array, 1484 uint16_t* utf16_array,
1485 intptr_t* length); 1485 intptr_t* length);
1486 1486
1487 /**
1488 * Gets the storage size in bytes of a String.
1489 *
1490 * \param str A String.
1491 * \param length Returns the storage size in bytes of the String.
1492 *
1493 * \return A valid handle if no error occurs during the operation.
1494 */
1495 DART_EXPORT Dart_Handle Dart_StringStorageSize(Dart_Handle str, intptr_t* size);
Ivan Posva 2012/11/15 06:17:15 I read the description and it is not clear to me w
siva 2012/11/15 21:34:13 Added comments to both Dart_StringStorageSize and
1496
1497
1498 /**
1499 * Converts a String into an ExternalString.
1500 * The original object is morphed into an external string object.
1501 *
1502 * \param array External space into which the string data will be
1503 * copied into. This must not move.
1504 * \param length The size in bytes of the provided external space (array).
1505 * \param peer An external pointer to associate with this string.
1506 * \param cback A callback to be called when this string is finalized.
1507 *
1508 * \return the converted ExternalString object if no error occurs.
1509 * Otherwise returns an error handle.
1510 */
1511 DART_EXPORT Dart_Handle Dart_MakeExternalString(Dart_Handle str,
1512 void* array,
1513 intptr_t length,
1514 void* peer,
1515 Dart_PeerFinalizer cback);
1516
1487 1517
1488 // --- Lists --- 1518 // --- Lists ---
1489 1519
1490 /** 1520 /**
1491 * Is this object a List? 1521 * Is this object a List?
1492 */ 1522 */
1493 DART_EXPORT bool Dart_IsList(Dart_Handle object); 1523 DART_EXPORT bool Dart_IsList(Dart_Handle object);
1494 1524
1495 /** 1525 /**
1496 * Returns a List of the desired length. 1526 * Returns a List of the desired length.
(...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after
2732 * 2762 *
2733 * \param object An object. 2763 * \param object An object.
2734 * \param peer A value to store in the peer field. 2764 * \param peer A value to store in the peer field.
2735 * 2765 *
2736 * \return Returns an error if 'object' is a subtype of Null, num, or 2766 * \return Returns an error if 'object' is a subtype of Null, num, or
2737 * bool. 2767 * bool.
2738 */ 2768 */
2739 DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer); 2769 DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer);
2740 2770
2741 #endif // INCLUDE_DART_API_H_ 2771 #endif // INCLUDE_DART_API_H_
OLDNEW
« no previous file with comments | « no previous file | vm/dart_api_impl.cc » ('j') | vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698