aboutsummaryrefslogtreecommitdiff
path: root/src/utilmoneystr.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-08-21 16:11:09 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-08-26 13:25:22 +0200
commitad49c256c33bfe4088fd3c7ecb7d28cb81a8fc70 (patch)
treec4152c73cf6a424a882a125fa89c59ee6869bb86 /src/utilmoneystr.h
parentf841aa2892ffd97d564deee103555149d9fbcd9a (diff)
downloadbitcoin-ad49c256c33bfe4088fd3c7ecb7d28cb81a8fc70.tar.xz
Split up util.cpp/h
Split up util.cpp/h into: - string utilities (hex, base32, base64): no internal dependencies, no dependency on boost (apart from foreach) - money utilities (parsesmoney, formatmoney) - time utilities (gettime*, sleep, format date): - and the rest (logging, argument parsing, config file parsing) The latter is basically the environment and OS handling, and is stripped of all utility functions, so we may want to rename it to something else than util.cpp/h for clarity (Matt suggested osinterface). Breaks dependency of sha256.cpp on all the things pulled in by util.
Diffstat (limited to 'src/utilmoneystr.h')
-rw-r--r--src/utilmoneystr.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/utilmoneystr.h b/src/utilmoneystr.h
new file mode 100644
index 0000000000..f0c61aa138
--- /dev/null
+++ b/src/utilmoneystr.h
@@ -0,0 +1,19 @@
+// Copyright (c) 2009-2010 Satoshi Nakamoto
+// Copyright (c) 2009-2014 The Bitcoin developers
+// Distributed under the MIT/X11 software license, see the accompanying
+// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+/**
+ * Money parsing/formatting utilities.
+ */
+#ifndef BITCOIN_UTILMONEYSTR_H
+#define BITCOIN_UTILMONEYSTR_H
+
+#include <stdint.h>
+#include <string>
+
+std::string FormatMoney(int64_t n, bool fPlus=false);
+bool ParseMoney(const std::string& str, int64_t& nRet);
+bool ParseMoney(const char* pszIn, int64_t& nRet);
+
+#endif // BITCOIN_UTILMONEYSTR_H