OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code by Matt McCutchen, see the LICENSE file. | 5 // Original code by Matt McCutchen, see the LICENSE file. |
6 | 6 |
7 #ifndef BIGINTEGERUTILS_H | 7 #ifndef BIGINTEGERUTILS_H |
8 #define BIGINTEGERUTILS_H | 8 #define BIGINTEGERUTILS_H |
9 | 9 |
10 #include "BigInteger.hh" | 10 #include "BigInteger.hh" |
11 #include <string> | 11 #include <string> |
12 #include <iostream> | 12 #include <ostream> |
13 | 13 |
14 /* This file provides: | 14 /* This file provides: |
15 * - Convenient std::string <-> BigUnsigned/BigInteger conversion routines | 15 * - Convenient std::string <-> BigUnsigned/BigInteger conversion routines |
16 * - std::ostream << operators for BigUnsigned/BigInteger */ | 16 * - std::ostream << operators for BigUnsigned/BigInteger */ |
17 | 17 |
18 // std::string conversion routines. Base 10 only. | 18 // std::string conversion routines. Base 10 only. |
19 std::string bigUnsignedToString(const BigUnsigned &x); | 19 std::string bigUnsignedToString(const BigUnsigned &x); |
20 std::string bigIntegerToString(const BigInteger &x); | 20 std::string bigIntegerToString(const BigInteger &x); |
21 BigUnsigned stringToBigUnsigned(const std::string &s); | 21 BigUnsigned stringToBigUnsigned(const std::string &s); |
22 BigInteger stringToBigInteger(const std::string &s); | 22 BigInteger stringToBigInteger(const std::string &s); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 } | 69 } |
70 | 70 |
71 // Create the BigInteger. | 71 // Create the BigInteger. |
72 BigInteger x(blocks, numBlocks, sign); | 72 BigInteger x(blocks, numBlocks, sign); |
73 | 73 |
74 delete [] blocks; | 74 delete [] blocks; |
75 return x; | 75 return x; |
76 } | 76 } |
77 | 77 |
78 #endif | 78 #endif |
OLD | NEW |