@@ -37,7 +37,6 @@ using namespace solidity;
37
37
using namespace solidity ::util;
38
38
using namespace solidity ::frontend;
39
39
using namespace solidity ::frontend::test;
40
- using namespace std ;
41
40
42
41
bytes BytesUtils::alignLeft (bytes _bytes)
43
42
{
@@ -73,7 +72,7 @@ bytes BytesUtils::applyAlign(
73
72
}
74
73
}
75
74
76
- bytes BytesUtils::convertBoolean (string const & _literal)
75
+ bytes BytesUtils::convertBoolean (std:: string const & _literal)
77
76
{
78
77
if (_literal == " true" )
79
78
return bytes{true };
@@ -83,7 +82,7 @@ bytes BytesUtils::convertBoolean(string const& _literal)
83
82
BOOST_THROW_EXCEPTION (TestParserError (" Boolean literal invalid." ));
84
83
}
85
84
86
- bytes BytesUtils::convertNumber (string const & _literal)
85
+ bytes BytesUtils::convertNumber (std:: string const & _literal)
87
86
{
88
87
try
89
88
{
@@ -95,13 +94,13 @@ bytes BytesUtils::convertNumber(string const& _literal)
95
94
}
96
95
}
97
96
98
- bytes BytesUtils::convertFixedPoint (string const & _literal, size_t & o_fractionalDigits)
97
+ bytes BytesUtils::convertFixedPoint (std:: string const & _literal, size_t & o_fractionalDigits)
99
98
{
100
99
size_t dotPos = _literal.find (' .' );
101
100
o_fractionalDigits = dotPos < _literal.size () ? _literal.size () - dotPos : 0 ;
102
101
bool negative = !_literal.empty () && _literal.at (0 ) == ' -' ;
103
102
// remove decimal point
104
- string valueInteger = _literal.substr (0 , dotPos) + _literal.substr (dotPos + 1 );
103
+ std:: string valueInteger = _literal.substr (0 , dotPos) + _literal.substr (dotPos + 1 );
105
104
// erase leading zeros to avoid parsing as octal.
106
105
while (!valueInteger.empty () && (valueInteger.at (0 ) == ' 0' || valueInteger.at (0 ) == ' -' ))
107
106
valueInteger.erase (valueInteger.begin ());
@@ -120,7 +119,7 @@ bytes BytesUtils::convertFixedPoint(string const& _literal, size_t& o_fractional
120
119
}
121
120
}
122
121
123
- bytes BytesUtils::convertHexNumber (string const & _literal)
122
+ bytes BytesUtils::convertHexNumber (std:: string const & _literal)
124
123
{
125
124
try
126
125
{
@@ -132,7 +131,7 @@ bytes BytesUtils::convertHexNumber(string const& _literal)
132
131
}
133
132
}
134
133
135
- bytes BytesUtils::convertString (string const & _literal)
134
+ bytes BytesUtils::convertString (std:: string const & _literal)
136
135
{
137
136
try
138
137
{
@@ -144,18 +143,18 @@ bytes BytesUtils::convertString(string const& _literal)
144
143
}
145
144
}
146
145
147
- string BytesUtils::formatUnsigned (bytes const & _bytes)
146
+ std:: string BytesUtils::formatUnsigned (bytes const & _bytes)
148
147
{
149
- stringstream os;
148
+ std:: stringstream os;
150
149
151
150
soltestAssert (!_bytes.empty () && _bytes.size () <= 32 , " " );
152
151
153
152
return fromBigEndian<u256>(_bytes).str ();
154
153
}
155
154
156
- string BytesUtils::formatSigned (bytes const & _bytes)
155
+ std:: string BytesUtils::formatSigned (bytes const & _bytes)
157
156
{
158
- stringstream os;
157
+ std:: stringstream os;
159
158
160
159
soltestAssert (!_bytes.empty () && _bytes.size () <= 32 , " " );
161
160
@@ -167,9 +166,9 @@ string BytesUtils::formatSigned(bytes const& _bytes)
167
166
return os.str ();
168
167
}
169
168
170
- string BytesUtils::formatBoolean (bytes const & _bytes)
169
+ std:: string BytesUtils::formatBoolean (bytes const & _bytes)
171
170
{
172
- stringstream os;
171
+ std:: stringstream os;
173
172
u256 result = fromBigEndian<u256>(_bytes);
174
173
175
174
if (result == 0 )
@@ -182,32 +181,32 @@ string BytesUtils::formatBoolean(bytes const& _bytes)
182
181
return os.str ();
183
182
}
184
183
185
- string BytesUtils::formatHex (bytes const & _bytes, bool _shorten)
184
+ std:: string BytesUtils::formatHex (bytes const & _bytes, bool _shorten)
186
185
{
187
186
soltestAssert (!_bytes.empty () && _bytes.size () <= 32 , " " );
188
187
u256 value = fromBigEndian<u256>(_bytes);
189
- string output = toCompactHexWithPrefix (value);
188
+ std:: string output = toCompactHexWithPrefix (value);
190
189
191
190
if (_shorten)
192
191
return output.substr (0 , output.size () - countRightPaddedZeros (_bytes) * 2 );
193
192
return output;
194
193
}
195
194
196
- string BytesUtils::formatHexString (bytes const & _bytes)
195
+ std:: string BytesUtils::formatHexString (bytes const & _bytes)
197
196
{
198
- stringstream os;
197
+ std:: stringstream os;
199
198
200
199
os << " hex\" " << util::toHex (_bytes) << " \" " ;
201
200
202
201
return os.str ();
203
202
}
204
203
205
- string BytesUtils::formatString (bytes const & _bytes, size_t _cutOff)
204
+ std:: string BytesUtils::formatString (bytes const & _bytes, size_t _cutOff)
206
205
{
207
- stringstream os;
206
+ std:: stringstream os;
208
207
209
208
os << " \" " ;
210
- for (size_t i = 0 ; i < min (_cutOff, _bytes.size ()); ++i)
209
+ for (size_t i = 0 ; i < std:: min (_cutOff, _bytes.size ()); ++i)
211
210
{
212
211
auto const v = _bytes[i];
213
212
switch (v)
@@ -232,7 +231,7 @@ string BytesUtils::formatString(bytes const& _bytes, size_t _cutOff)
232
231
233
232
std::string BytesUtils::formatFixedPoint (bytes const & _bytes, bool _signed, size_t _fractionalDigits)
234
233
{
235
- string decimal;
234
+ std:: string decimal;
236
235
bool negative = false ;
237
236
if (_signed)
238
237
{
@@ -246,19 +245,19 @@ std::string BytesUtils::formatFixedPoint(bytes const& _bytes, bool _signed, size
246
245
{
247
246
size_t numDigits = decimal.length () - (negative ? 1 : 0 );
248
247
if (_fractionalDigits >= numDigits)
249
- decimal.insert (negative ? 1 : 0 , string (_fractionalDigits + 1 - numDigits, ' 0' ));
248
+ decimal.insert (negative ? 1 : 0 , std:: string (_fractionalDigits + 1 - numDigits, ' 0' ));
250
249
decimal.insert (decimal.length () - _fractionalDigits, " ." );
251
250
}
252
251
return decimal;
253
252
}
254
253
255
- string BytesUtils::formatRawBytes (
254
+ std:: string BytesUtils::formatRawBytes (
256
255
bytes const & _bytes,
257
256
solidity::frontend::test::ParameterList const & _parameters,
258
- string _linePrefix
257
+ std:: string _linePrefix
259
258
)
260
259
{
261
- stringstream os;
260
+ std:: stringstream os;
262
261
ParameterList parameters;
263
262
auto it = _bytes.begin ();
264
263
@@ -283,7 +282,7 @@ string BytesUtils::formatRawBytes(
283
282
284
283
for (auto const & parameter: parameters)
285
284
{
286
- long actualSize = min (
285
+ long actualSize = std:: min (
287
286
distance (it, _bytes.end ()),
288
287
static_cast <ParameterList::difference_type>(parameter.abiType .size )
289
288
);
@@ -292,20 +291,20 @@ string BytesUtils::formatRawBytes(
292
291
293
292
os << _linePrefix << byteRange;
294
293
if (¶meter != ¶meters.back ())
295
- os << endl;
294
+ os << std:: endl;
296
295
297
296
it += actualSize;
298
297
}
299
298
300
299
return os.str ();
301
300
}
302
301
303
- string BytesUtils::formatBytes (
302
+ std:: string BytesUtils::formatBytes (
304
303
bytes const & _bytes,
305
304
ABIType const & _abiType
306
305
)
307
306
{
308
- stringstream os;
307
+ std:: stringstream os;
309
308
310
309
switch (_abiType.type )
311
310
{
@@ -330,7 +329,7 @@ string BytesUtils::formatBytes(
330
329
{
331
330
auto entropy = [](std::string const & str) -> double {
332
331
double result = 0 ;
333
- map<char , double > frequencies;
332
+ std:: map<char , double > frequencies;
334
333
for (char c: str)
335
334
frequencies[c]++;
336
335
for (auto p: frequencies)
@@ -376,13 +375,13 @@ string BytesUtils::formatBytes(
376
375
return os.str ();
377
376
}
378
377
379
- string BytesUtils::formatBytesRange (
378
+ std:: string BytesUtils::formatBytesRange (
380
379
bytes _bytes,
381
380
solidity::frontend::test::ParameterList const & _parameters,
382
381
bool _highlight
383
382
)
384
383
{
385
- stringstream os;
384
+ std:: stringstream os;
386
385
ParameterList parameters;
387
386
auto it = _bytes.begin ();
388
387
@@ -407,7 +406,7 @@ string BytesUtils::formatBytesRange(
407
406
408
407
for (auto const & parameter: parameters)
409
408
{
410
- long actualSize = min (
409
+ long actualSize = std:: min (
411
410
distance (it, _bytes.end ()),
412
411
static_cast <ParameterList::difference_type>(parameter.abiType .size )
413
412
);
0 commit comments