| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 // Converts a string into a double value according to ECMA-262 9.3.1 | 95 // Converts a string into a double value according to ECMA-262 9.3.1 |
| 96 double StringToDouble(UnicodeCache* unicode_cache, | 96 double StringToDouble(UnicodeCache* unicode_cache, |
| 97 String* str, | 97 String* str, |
| 98 int flags, | 98 int flags, |
| 99 double empty_string_val = 0); | 99 double empty_string_val = 0); |
| 100 double StringToDouble(UnicodeCache* unicode_cache, | 100 double StringToDouble(UnicodeCache* unicode_cache, |
| 101 Vector<const char> str, | 101 Vector<const char> str, |
| 102 int flags, | 102 int flags, |
| 103 double empty_string_val = 0); | 103 double empty_string_val = 0); |
| 104 double StringToDouble(UnicodeCache* unicode_cache, |
| 105 Vector<const uc16> str, |
| 106 int flags, |
| 107 double empty_string_val = 0); |
| 104 // This version expects a zero-terminated character array. | 108 // This version expects a zero-terminated character array. |
| 105 double StringToDouble(UnicodeCache* unicode_cache, | 109 double StringToDouble(UnicodeCache* unicode_cache, |
| 106 const char* str, | 110 const char* str, |
| 107 int flags, | 111 int flags, |
| 108 double empty_string_val = 0); | 112 double empty_string_val = 0); |
| 109 | 113 |
| 110 // Converts a string into an integer. | 114 // Converts a string into an integer. |
| 111 double StringToInt(UnicodeCache* unicode_cache, String* str, int radix); | 115 double StringToInt(UnicodeCache* unicode_cache, String* str, int radix); |
| 112 | 116 |
| 113 // Converts a double to a string value according to ECMA-262 9.8.1. | 117 // Converts a double to a string value according to ECMA-262 9.8.1. |
| 114 // The buffer should be large enough for any floating point number. | 118 // The buffer should be large enough for any floating point number. |
| 115 // 100 characters is enough. | 119 // 100 characters is enough. |
| 116 const char* DoubleToCString(double value, Vector<char> buffer); | 120 const char* DoubleToCString(double value, Vector<char> buffer); |
| 117 | 121 |
| 118 // Convert an int to a null-terminated string. The returned string is | 122 // Convert an int to a null-terminated string. The returned string is |
| 119 // located inside the buffer, but not necessarily at the start. | 123 // located inside the buffer, but not necessarily at the start. |
| 120 const char* IntToCString(int n, Vector<char> buffer); | 124 const char* IntToCString(int n, Vector<char> buffer); |
| 121 | 125 |
| 122 // Additional number to string conversions for the number type. | 126 // Additional number to string conversions for the number type. |
| 123 // The caller is responsible for calling free on the returned pointer. | 127 // The caller is responsible for calling free on the returned pointer. |
| 124 char* DoubleToFixedCString(double value, int f); | 128 char* DoubleToFixedCString(double value, int f); |
| 125 char* DoubleToExponentialCString(double value, int f); | 129 char* DoubleToExponentialCString(double value, int f); |
| 126 char* DoubleToPrecisionCString(double value, int f); | 130 char* DoubleToPrecisionCString(double value, int f); |
| 127 char* DoubleToRadixCString(double value, int radix); | 131 char* DoubleToRadixCString(double value, int radix); |
| 128 | 132 |
| 129 } } // namespace v8::internal | 133 } } // namespace v8::internal |
| 130 | 134 |
| 131 #endif // V8_CONVERSIONS_H_ | 135 #endif // V8_CONVERSIONS_H_ |
| OLD | NEW |