22 #define IS_TYPE(type, name) (name==TypeTraits::type2label((type)0))
24 #include <odindata/data.h>
25 #include <odindata/fileio_opts.h>
28 #define AUTODETECTSTR "autodetect"
29 #define AUTOTDATAYPESTR "automatic"
45 enum dataDim { timeDim=0, sliceDim, phaseDim, readDim, n_dataDim };
46 static const char* dataDimLabel[]={
"time",
"slice",
"phase",
"read"};
47 AVOID_CC_WARNING(dataDimLabel)
59 static bool get_trace_status() {
return do_trace;}
64 static void set_trace_status(
bool stat) {do_trace=stat;}
68 static logPriority loglevel() {
if(get_trace_status())
return infoLog;
else return normalDebug;}
118 static const char* get_compName();
166 virtual STD_string description()
const = 0;
168 virtual svector suffix()
const = 0;
170 virtual svector dialects()
const = 0;
178 typedef STD_list<FileFormat*> FormatList;
179 typedef STD_map<STD_string, FormatList> FormatMap;
180 static FormatMap formats;
182 static STD_string analyze_suffix(
const STD_string& filename);
184 static FileFormat* get_format(
const STD_string& filename,
const STD_string& override_suffix);
186 static svector possible_formats();
188 static STD_string formats_str(
const STD_string& indent);
190 static void format_error(
const STD_string& filename);
STD_map< Protocol, Data< float, 4 > > ProtocolDataMap
static svector autoformats()
static int autowrite(const ProtocolDataMap &pdmap, const STD_string &filename, const FileWriteOpts &opts)
static int autoread(ProtocolDataMap &pdmap, const STD_string &filename, const FileReadOpts &opts, const Protocol &protocol_template, ProgressMeter *progmeter=0)
static STD_string autoformats_str(const STD_string &indent="")
int write(const STD_string &str, const STD_string &filename, fopenMode mode=overwriteMode)