summaryrefslogtreecommitdiff
path: root/indra/llcommon/u64.h
diff options
context:
space:
mode:
authorJosh Bell <josh@lindenlab.com>2007-12-29 01:40:57 +0000
committerJosh Bell <josh@lindenlab.com>2007-12-29 01:40:57 +0000
commitd06e5e3519f13197dd62bfbabf76f7efcc3d7a79 (patch)
tree62b363ba11a3cc7dd78343e63ad440284f0252f3 /indra/llcommon/u64.h
parent79680891a73be074aa449a9ccdf695b0afd300d8 (diff)
svn merge -r 76642:76643 svn+ssh://svn.lindenlab.com/svn/linden/qa/maintenance-4-merge-76640
Redo of QAR-170, with correct range. Reviewed by CG.
Diffstat (limited to 'indra/llcommon/u64.h')
-rw-r--r--indra/llcommon/u64.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/indra/llcommon/u64.h b/indra/llcommon/u64.h
index ad93ebffe7..f4580513bc 100644
--- a/indra/llcommon/u64.h
+++ b/indra/llcommon/u64.h
@@ -32,11 +32,41 @@
#ifndef LL_U64_H
#define LL_U64_H
+/**
+ * @brief Forgivingly parse a null terminated character array.
+ *
+ * @param str The string to parse.
+ * @return Returns the first U64 value found in the string or 0 on failure.
+ */
U64 str_to_U64(const char* str);
+
+/**
+ * @brief Given a U64 value, return a printable representation.
+ *
+ * The client of this function is expected to provide an allocated
+ * buffer. The function then snprintf() into that buffer, so providing
+ * NULL has undefined behavior. Providing a buffer which is too small
+ * will truncate the printable value, so usually you want to declare
+ * the buffer:
+ *
+ * char result[U64_BUF];
+ * std::cout << "value: " << U64_to_str(value, result, U64_BUF);
+ *
+ * @param value The U64 to turn into a printable character array.
+ * @param result The buffer to use
+ * @param result_size The size of the buffer allocated. Use U64_BUF.
+ * @return Returns the result pointer.
+ */
char* U64_to_str(U64 value, char* result, S32 result_size);
+/**
+ * @brief Convert a U64 to the closest F64 value.
+ */
F64 U64_to_F64(const U64 value);
+/**
+ * @brief Helper function to wrap strtoull() which is not available on windows.
+ */
U64 llstrtou64(const char* str, char** end, S32 base);
#endif