#include <cassert>
#include <cctype>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <Array.h>
#include "byte-swap.h"
#include "lo-ieee.h"
#include "lo-mappers.h"
#include "lo-utils.h"
#include "str-vec.h"
#include "quit.h"
#include "error.h"
#include "gripes.h"
#include "input.h"
#include "oct-stdstrm.h"
#include "oct-stream.h"
#include "oct-obj.h"
#include "utils.h"
#define BEGIN_C_CONVERSION | ( | ) |
Value:
is.unsetf (std::ios::skipws); \ \ int width = elt->width ? elt->width : 1; \ \ char *tbuf = new char[width + 1]; \ \ int c = EOF; \ int n = 0; \ \ while (is && n < width && (c = is.get ()) != EOF) \ tbuf[n++] = static_cast<char> (c); \ \ tbuf[n] = '\0'; \ \ if (n > 0 && c == EOF) \ is.clear (); \ \ std::string tmp = tbuf; \ \ delete [] tbuf
#define BEGIN_CHAR_CLASS_CONVERSION | ( | ) |
#define BEGIN_S_CONVERSION | ( | ) |
#define DO_DOUBLE_CONV | ( | TQUAL | ) |
Value:
do \ { \ if (val > std::numeric_limits<TQUAL long>::max () \ || val < std::numeric_limits<TQUAL long>::min ()) \ { \ std::string tfmt = fmt; \ \ tfmt.replace (tfmt.rfind (elt->type), 1, ".f"); \ \ if (elt->modifier == 'l') \ tfmt.replace (tfmt.rfind (elt->modifier), 1, ""); \ \ retval += do_printf_conv (os, tfmt.c_str (), nsa, sa_1, sa_2, \ val, who); \ } \ else \ retval += do_printf_conv (os, fmt, nsa, sa_1, sa_2, \ static_cast<TQUAL long> (val), who); \ } \ while (0)
#define DO_LITERAL_CONVERSION | ( | ) |
Value:
do \ { \ int c = EOF; \ \ int n = strlen (fmt); \ int i = 0; \ \ while (i < n && is && (c = is.get ()) != EOF) \ { \ if (c == static_cast<unsigned char> (fmt[i])) \ { \ i++; \ continue; \ } \ else \ { \ is.putback (c); \ break; \ } \ } \ \ if (i != n) \ is.setstate (std::ios::failbit); \ } \ while (0)
#define DO_PCT_CONVERSION | ( | ) |
#define DO_READ_VAL_TEMPLATE | ( | RET_T, | |||
READ_T | ) |
Value:
template octave_value \ do_read<RET_T, READ_T> (octave_stream&, octave_idx_type, octave_idx_type, octave_idx_type, octave_idx_type, bool, bool, \ oct_mach_info::float_format, octave_idx_type&)
#define DO_WHITESPACE_CONVERSION | ( | ) |
#define FILL_TABLE_ROW | ( | R, | |||
VAL_T | ) |
Value:
read_fptr_table[R][oct_data_conv::dt_int8] = do_read<VAL_T, octave_int8>; \ read_fptr_table[R][oct_data_conv::dt_uint8] = do_read<VAL_T, octave_uint8>; \ read_fptr_table[R][oct_data_conv::dt_int16] = do_read<VAL_T, octave_int16>; \ read_fptr_table[R][oct_data_conv::dt_uint16] = do_read<VAL_T, octave_uint16>; \ read_fptr_table[R][oct_data_conv::dt_int32] = do_read<VAL_T, octave_int32>; \ read_fptr_table[R][oct_data_conv::dt_uint32] = do_read<VAL_T, octave_uint32>; \ read_fptr_table[R][oct_data_conv::dt_int64] = do_read<VAL_T, octave_int64>; \ read_fptr_table[R][oct_data_conv::dt_uint64] = do_read<VAL_T, octave_uint64>; \ read_fptr_table[R][oct_data_conv::dt_single] = do_read<VAL_T, float>; \ read_fptr_table[R][oct_data_conv::dt_double] = do_read<VAL_T, double>; \ read_fptr_table[R][oct_data_conv::dt_char] = do_read<VAL_T, char>; \ read_fptr_table[R][oct_data_conv::dt_schar] = do_read<VAL_T, signed char>; \ read_fptr_table[R][oct_data_conv::dt_uchar] = do_read<VAL_T, unsigned char>; \ read_fptr_table[R][oct_data_conv::dt_logical] = do_read<VAL_T, unsigned char>
#define FINISH_CHARACTER_CONVERSION | ( | ) |
#define INSTANTIATE_DO_READ | ( | VAL_T | ) |
Value:
DO_READ_VAL_TEMPLATE (VAL_T, octave_int8); \ DO_READ_VAL_TEMPLATE (VAL_T, octave_uint8); \ DO_READ_VAL_TEMPLATE (VAL_T, octave_int16); \ DO_READ_VAL_TEMPLATE (VAL_T, octave_uint16); \ DO_READ_VAL_TEMPLATE (VAL_T, octave_int32); \ DO_READ_VAL_TEMPLATE (VAL_T, octave_uint32); \ DO_READ_VAL_TEMPLATE (VAL_T, octave_int64); \ DO_READ_VAL_TEMPLATE (VAL_T, octave_uint64); \ DO_READ_VAL_TEMPLATE (VAL_T, float); \ DO_READ_VAL_TEMPLATE (VAL_T, double); \ DO_READ_VAL_TEMPLATE (VAL_T, char); \ DO_READ_VAL_TEMPLATE (VAL_T, signed char); \ DO_READ_VAL_TEMPLATE (VAL_T, unsigned char)
typedef octave_value(* read_fptr)(octave_stream &, octave_idx_type, octave_idx_type, octave_idx_type, octave_idx_type, bool, bool, oct_mach_info::float_format ffmt, octave_idx_type &) |
template int do_printf_conv | ( | std::ostream & | , | |
const char * | , | |||
int | , | |||
int | , | |||
int | , | |||
const char * | , | |||
const std::string & | ||||
) |
template int do_printf_conv | ( | std::ostream & | , | |
const char * | , | |||
int | , | |||
int | , | |||
int | , | |||
double | , | |||
const std::string & | ||||
) |
template int do_printf_conv | ( | std::ostream & | , | |
const char * | , | |||
int | , | |||
int | , | |||
int | , | |||
unsigned | int, | |||
const std::string & | ||||
) |
template int do_printf_conv | ( | std::ostream & | , | |
const char * | , | |||
int | , | |||
int | , | |||
int | , | |||
long | , | |||
const std::string & | ||||
) |
template int do_printf_conv | ( | std::ostream & | , | |
const char * | , | |||
int | , | |||
int | , | |||
int | , | |||
int | , | |||
const std::string & | ||||
) |
int do_printf_conv | ( | std::ostream & | os, | |
const char * | fmt, | |||
int | nsa, | |||
int | sa_1, | |||
int | sa_2, | |||
T | arg, | |||
const std::string & | who | |||
) | [inline] |
octave_value do_read | ( | octave_stream & | strm, | |
octave_idx_type | nr, | |||
octave_idx_type | nc, | |||
octave_idx_type | block_size, | |||
octave_idx_type | skip, | |||
bool | do_float_fmt_conv, | |||
bool | do_NA_conv, | |||
oct_mach_info::float_format | from_flt_fmt, | |||
octave_idx_type & | count | |||
) | [inline] |
template void do_scanf_conv | ( | std::istream & | , | |
const scanf_format_elt & | , | |||
double * | , | |||
Matrix & | , | |||
double * | , | |||
octave_idx_type & | , | |||
octave_idx_type & | , | |||
octave_idx_type | , | |||
octave_idx_type | , | |||
bool | ||||
) |
template void do_scanf_conv | ( | std::istream & | , | |
const scanf_format_elt & | , | |||
unsigned short int * | , | |||
Matrix & | , | |||
double * | , | |||
octave_idx_type & | , | |||
octave_idx_type & | , | |||
octave_idx_type | , | |||
octave_idx_type | , | |||
bool | ||||
) |
template void do_scanf_conv | ( | std::istream & | , | |
const scanf_format_elt & | , | |||
unsigned long int * | , | |||
Matrix & | , | |||
double * | , | |||
octave_idx_type & | , | |||
octave_idx_type & | , | |||
octave_idx_type | , | |||
octave_idx_type | , | |||
bool | ||||
) |
template void do_scanf_conv | ( | std::istream & | , | |
const scanf_format_elt & | , | |||
unsigned int * | , | |||
Matrix & | , | |||
double * | , | |||
octave_idx_type & | , | |||
octave_idx_type & | , | |||
octave_idx_type | , | |||
octave_idx_type | , | |||
bool | ||||
) |
template void do_scanf_conv | ( | std::istream & | , | |
const scanf_format_elt & | , | |||
short int * | , | |||
Matrix & | , | |||
double * | , | |||
octave_idx_type & | , | |||
octave_idx_type & | , | |||
octave_idx_type | , | |||
octave_idx_type | , | |||
bool | ||||
) |
template void do_scanf_conv | ( | std::istream & | , | |
const scanf_format_elt & | , | |||
long int * | , | |||
Matrix & | , | |||
double * | , | |||
octave_idx_type & | , | |||
octave_idx_type & | , | |||
octave_idx_type | , | |||
octave_idx_type | , | |||
bool | ||||
) |
template void do_scanf_conv | ( | std::istream & | , | |
const scanf_format_elt & | , | |||
int * | , | |||
Matrix & | , | |||
double * | , | |||
octave_idx_type & | , | |||
octave_idx_type & | , | |||
octave_idx_type | , | |||
octave_idx_type | , | |||
bool | ||||
) |
void do_scanf_conv | ( | std::istream & | is, | |
const scanf_format_elt & | fmt, | |||
T | valptr, | |||
Matrix & | mval, | |||
double * | data, | |||
octave_idx_type & | idx, | |||
octave_idx_type & | conversion_count, | |||
octave_idx_type | nr, | |||
octave_idx_type | max_size, | |||
bool | discard | |||
) | [inline] |
template bool do_write | ( | std::ostream & | , | |
const octave_int8 & | , | |||
oct_data_conv::data_type | , | |||
oct_mach_info::float_format | , | |||
bool | , | |||
bool | ||||
) |
INSTANTIATE_DO_READ | ( | boolNDArray | ) |
INSTANTIATE_DO_READ | ( | charNDArray | ) |
INSTANTIATE_DO_READ | ( | NDArray | ) |
INSTANTIATE_DO_READ | ( | FloatNDArray | ) |
INSTANTIATE_DO_READ | ( | int8NDArray | ) |
std::istream& octave_scan | ( | std::istream & | is, | |
const scanf_format_elt & | fmt, | |||
double * | valptr | |||
) | [inline] |
template std::istream& octave_scan | ( | std::istream & | , | |
const scanf_format_elt & | , | |||
unsigned short int * | ||||
) |
template std::istream& octave_scan | ( | std::istream & | , | |
const scanf_format_elt & | , | |||
unsigned long int * | ||||
) |
template std::istream& octave_scan | ( | std::istream & | , | |
const scanf_format_elt & | , | |||
unsigned int * | ||||
) |
template std::istream& octave_scan | ( | std::istream & | , | |
const scanf_format_elt & | , | |||
short int * | ||||
) |
template std::istream& octave_scan | ( | std::istream & | , | |
const scanf_format_elt & | , | |||
long int * | ||||
) |
template std::istream& octave_scan | ( | std::istream & | , | |
const scanf_format_elt & | , | |||
int * | ||||
) |
std::istream& octave_scan | ( | std::istream & | is, | |
const scanf_format_elt & | , | |||
char * | valptr | |||
) | [inline] |
std::istream& octave_scan | ( | std::istream & | is, | |
const scanf_format_elt & | fmt, | |||
T * | valptr | |||
) | [inline] |
std::istream& octave_scan_1 | ( | std::istream & | is, | |
const scanf_format_elt & | fmt, | |||
T * | valptr | |||
) | [inline] |
template void write_int | ( | std::ostream & | , | |
bool | , | |||
const octave_int8 & | ||||
) |
void write_int | ( | std::ostream & | os, | |
bool | swap, | |||
const T & | val | |||
) | [inline] |