File indexing completed on 2026-05-19 08:08:31
0001
0002
0003 #ifndef _CL_INTEGER_IO_H
0004 #define _CL_INTEGER_IO_H
0005
0006 #include "cln/number_io.h"
0007 #include "cln/integer_class.h"
0008
0009 namespace cln {
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 extern const cl_I read_integer (unsigned int base,
0024 cl_signean sign, const char * string, uintC index1, uintC index2);
0025
0026
0027
0028
0029 extern const cl_I read_integer (const cl_read_flags& flags, const char * string, const char * string_limit, const char * * end_of_parse);
0030 extern const cl_I read_integer (std::istream& stream, const cl_read_flags& flags);
0031
0032 inline std::istream& operator>> (std::istream& stream, cl_I& result)
0033 {
0034 extern cl_read_flags cl_I_read_flags;
0035 result = read_integer(stream,cl_I_read_flags);
0036 return stream;
0037 }
0038
0039
0040
0041
0042
0043
0044
0045 extern char * cl_decimal_string (const cl_I& x);
0046
0047
0048
0049
0050
0051
0052 extern void print_integer (std::ostream& stream, unsigned int base, const cl_I& z);
0053
0054 extern char * print_integer_to_string (unsigned int base, const cl_I& z);
0055
0056 inline void fprintdecimal (std::ostream& stream, const cl_I& x)
0057 {
0058 print_integer(stream,10,x);
0059 }
0060
0061 inline void fprintbinary (std::ostream& stream, const cl_I& x)
0062 {
0063 print_integer(stream,2,x);
0064 }
0065
0066 inline void fprintoctal (std::ostream& stream, const cl_I& x)
0067 {
0068 print_integer(stream,8,x);
0069 }
0070
0071 inline void fprinthexadecimal (std::ostream& stream, const cl_I& x)
0072 {
0073 print_integer(stream,16,x);
0074 }
0075
0076
0077
0078
0079
0080
0081 extern void print_integer (std::ostream& stream, const cl_print_flags& flags, const cl_I& z);
0082 extern void print_integer (std::ostream& stream, const cl_print_number_flags& flags, const cl_I& z);
0083 extern void print_integer (std::ostream& stream, const cl_print_real_flags& flags, const cl_I& z);
0084 extern void print_integer (std::ostream& stream, const cl_print_rational_flags& flags, const cl_I& z);
0085
0086
0087
0088
0089
0090 inline void fprint (std::ostream& stream, const cl_I& x)
0091 {
0092 extern cl_print_flags default_print_flags;
0093 print_integer(stream,default_print_flags,x);
0094 }
0095
0096 CL_DEFINE_PRINT_OPERATOR(cl_I)
0097
0098 }
0099
0100 #endif