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

Side by Side Diff: third_party/WebKit/Source/wtf/HexNumber.h

Issue 1937723002: remove unused placeByteAsHex template (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. 2 * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 template<typename T> 43 template<typename T>
44 inline void appendByteAsHex(unsigned char byte, T& destination, HexConversionMod e mode = Uppercase) 44 inline void appendByteAsHex(unsigned char byte, T& destination, HexConversionMod e mode = Uppercase)
45 { 45 {
46 const LChar* hexDigits = Internal::hexDigitsForMode(mode); 46 const LChar* hexDigits = Internal::hexDigitsForMode(mode);
47 destination.append(hexDigits[byte >> 4]); 47 destination.append(hexDigits[byte >> 4]);
48 destination.append(hexDigits[byte & 0xF]); 48 destination.append(hexDigits[byte & 0xF]);
49 } 49 }
50 50
51 template<typename T> 51 template<typename T>
52 inline void placeByteAsHex(unsigned char byte, T& destination, HexConversionMode mode = Uppercase)
53 {
54 const LChar* hexDigits = Internal::hexDigitsForMode(mode);
55 *destination++ = hexDigits[byte >> 4];
56 *destination++ = hexDigits[byte & 0xF];
57 }
58
59 template<typename T>
60 inline void appendUnsignedAsHex(unsigned number, T& destination, HexConversionMo de mode = Uppercase) 52 inline void appendUnsignedAsHex(unsigned number, T& destination, HexConversionMo de mode = Uppercase)
61 { 53 {
62 const LChar* hexDigits = Internal::hexDigitsForMode(mode); 54 const LChar* hexDigits = Internal::hexDigitsForMode(mode);
63 Vector<LChar, 8> result; 55 Vector<LChar, 8> result;
64 do { 56 do {
65 result.prepend(hexDigits[number % 16]); 57 result.prepend(hexDigits[number % 16]);
66 number >>= 4; 58 number >>= 4;
67 } while (number > 0); 59 } while (number > 0);
68 60
69 destination.append(result.data(), result.size()); 61 destination.append(result.data(), result.size());
(...skipping 14 matching lines...) Expand all
84 76
85 ASSERT(result.size() == desiredDigits); 77 ASSERT(result.size() == desiredDigits);
86 destination.append(result.data(), result.size()); 78 destination.append(result.data(), result.size());
87 } 79 }
88 80
89 } // namespace WTF 81 } // namespace WTF
90 82
91 using WTF::appendByteAsHex; 83 using WTF::appendByteAsHex;
92 using WTF::appendUnsignedAsHex; 84 using WTF::appendUnsignedAsHex;
93 using WTF::appendUnsignedAsHexFixedSize; 85 using WTF::appendUnsignedAsHexFixedSize;
94 using WTF::placeByteAsHex;
95 using WTF::Lowercase; 86 using WTF::Lowercase;
96 87
97 #endif // HexNumber_h 88 #endif // HexNumber_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698