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

Side by Side Diff: third_party/WebKit/Source/wtf/text/WTFString.h

Issue 2058613002: Move WTF string to number converter functions to StringToNumber.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missing files. Created 4 years, 6 months 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
OLDNEW
1 /* 1 /*
2 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 24 matching lines...) Expand all
35 35
36 #ifdef __OBJC__ 36 #ifdef __OBJC__
37 #include <objc/objc.h> 37 #include <objc/objc.h>
38 #endif 38 #endif
39 39
40 namespace WTF { 40 namespace WTF {
41 41
42 class CString; 42 class CString;
43 struct StringHash; 43 struct StringHash;
44 44
45 // Declarations of string operations
46
47 WTF_EXPORT int charactersToIntStrict(const LChar*, size_t, bool* ok = 0, int bas e = 10);
48 WTF_EXPORT int charactersToIntStrict(const UChar*, size_t, bool* ok = 0, int bas e = 10);
49 WTF_EXPORT unsigned charactersToUIntStrict(const LChar*, size_t, bool* ok = 0, i nt base = 10);
50 WTF_EXPORT unsigned charactersToUIntStrict(const UChar*, size_t, bool* ok = 0, i nt base = 10);
51 WTF_EXPORT int64_t charactersToInt64Strict(const LChar*, size_t, bool* ok = 0, i nt base = 10);
52 WTF_EXPORT int64_t charactersToInt64Strict(const UChar*, size_t, bool* ok = 0, i nt base = 10);
53 WTF_EXPORT uint64_t charactersToUInt64Strict(const LChar*, size_t, bool* ok = 0, int base = 10);
54 WTF_EXPORT uint64_t charactersToUInt64Strict(const UChar*, size_t, bool* ok = 0, int base = 10);
55
56 WTF_EXPORT int charactersToInt(const LChar*, size_t, bool* ok = 0); // ignores t railing garbage
57 WTF_EXPORT int charactersToInt(const UChar*, size_t, bool* ok = 0); // ignores t railing garbage
58 WTF_EXPORT unsigned charactersToUInt(const LChar*, size_t, bool* ok = 0); // ign ores trailing garbage
59 WTF_EXPORT unsigned charactersToUInt(const UChar*, size_t, bool* ok = 0); // ign ores trailing garbage
60 WTF_EXPORT int64_t charactersToInt64(const LChar*, size_t, bool* ok = 0); // ign ores trailing garbage
61 WTF_EXPORT int64_t charactersToInt64(const UChar*, size_t, bool* ok = 0); // ign ores trailing garbage
62 WTF_EXPORT uint64_t charactersToUInt64(const LChar*, size_t, bool* ok = 0); // i gnores trailing garbage
63 WTF_EXPORT uint64_t charactersToUInt64(const UChar*, size_t, bool* ok = 0); // i gnores trailing garbage
64
65 // FIXME: Like the strict functions above, these give false for "ok" when there
66 // is trailing garbage. Like the non-strict functions above, these return the
67 // value when there is trailing garbage. It would be better if these were more
68 // consistent with the above functions instead.
69 WTF_EXPORT double charactersToDouble(const LChar*, size_t, bool* ok = 0);
70 WTF_EXPORT double charactersToDouble(const UChar*, size_t, bool* ok = 0);
71 WTF_EXPORT double charactersToDouble(const LChar*, size_t, size_t& parsedLength) ;
72 WTF_EXPORT double charactersToDouble(const UChar*, size_t, size_t& parsedLength) ;
73 WTF_EXPORT float charactersToFloat(const LChar*, size_t, bool* ok = 0);
74 WTF_EXPORT float charactersToFloat(const UChar*, size_t, bool* ok = 0);
75 WTF_EXPORT float charactersToFloat(const LChar*, size_t, size_t& parsedLength);
76 WTF_EXPORT float charactersToFloat(const UChar*, size_t, size_t& parsedLength);
77
78 enum TrailingZerosTruncatingPolicy { 45 enum TrailingZerosTruncatingPolicy {
79 KeepTrailingZeros, 46 KeepTrailingZeros,
80 TruncateTrailingZeros 47 TruncateTrailingZeros
81 }; 48 };
82 49
83 enum UTF8ConversionMode { 50 enum UTF8ConversionMode {
84 LenientUTF8Conversion, 51 LenientUTF8Conversion,
85 StrictUTF8Conversion, 52 StrictUTF8Conversion,
86 StrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD 53 StrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD
87 }; 54 };
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 645
679 using WTF::CString; 646 using WTF::CString;
680 using WTF::KeepTrailingZeros; 647 using WTF::KeepTrailingZeros;
681 using WTF::StrictUTF8Conversion; 648 using WTF::StrictUTF8Conversion;
682 using WTF::StrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD; 649 using WTF::StrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD;
683 using WTF::String; 650 using WTF::String;
684 using WTF::emptyString; 651 using WTF::emptyString;
685 using WTF::emptyString16Bit; 652 using WTF::emptyString16Bit;
686 using WTF::append; 653 using WTF::append;
687 using WTF::charactersAreAllASCII; 654 using WTF::charactersAreAllASCII;
688 using WTF::charactersToIntStrict;
689 using WTF::charactersToUIntStrict;
690 using WTF::charactersToInt64Strict;
691 using WTF::charactersToUInt64Strict;
692 using WTF::charactersToInt;
693 using WTF::charactersToUInt;
694 using WTF::charactersToInt64;
695 using WTF::charactersToUInt64;
696 using WTF::charactersToDouble;
697 using WTF::charactersToFloat;
698 using WTF::equal; 655 using WTF::equal;
699 using WTF::equalIgnoringCase; 656 using WTF::equalIgnoringCase;
700 using WTF::find; 657 using WTF::find;
701 using WTF::isAllSpecialCharacters; 658 using WTF::isAllSpecialCharacters;
702 using WTF::isSpaceOrNewline; 659 using WTF::isSpaceOrNewline;
703 using WTF::reverseFind; 660 using WTF::reverseFind;
704 661
705 #include "wtf/text/AtomicString.h" 662 #include "wtf/text/AtomicString.h"
706 #endif // WTFString_h 663 #endif // WTFString_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringToNumber.cpp ('k') | third_party/WebKit/Source/wtf/text/WTFString.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698