File indexing completed on 2025-04-19 09:13:42
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 static void write(std::ostream& stream, const AnalysisObject& ao) {
0011 create().write(stream, ao);
0012 }
0013
0014
0015 template <typename T>
0016 static typename std::enable_if<DerefableToAO<T>::value>::type
0017 write(std::ostream& stream, const T& ao, int precision=-1) { write(stream, *ao, precision); }
0018
0019
0020 static void write(const std::string& filename, const AnalysisObject& ao, int precision=-1) {
0021 const size_t lastdot = filename.find_last_of(".");
0022 std::string fmt = Utils::toLower(lastdot == std::string::npos ? filename : filename.substr(lastdot+1));
0023 const bool compress = (fmt == "gz");
0024 Writer& w = create();
0025 if (precision > 0) w.setPrecision(precision);
0026 w.useCompression(compress);
0027 w.write(filename, ao);
0028 }
0029
0030
0031 template <typename T>
0032 static typename std::enable_if<DerefableToAO<T>::value>::type
0033 write(const std::string& filename, const T& ao, int precision=-1) { write(filename, *ao, precision); }
0034
0035
0036
0037
0038
0039
0040
0041 template <typename RANGE>
0042 static typename std::enable_if<CIterable<RANGE>::value>::type
0043 write(std::ostream& stream, const RANGE& aos, int precision=-1) {
0044 create().write(stream, std::begin(aos), std::end(aos), precision);
0045 }
0046
0047 template <typename RANGE>
0048 static typename std::enable_if<CIterable<RANGE>::value>::type
0049 write(const std::string& filename, const RANGE& aos, int precision=-1) {
0050 const size_t lastdot = filename.find_last_of(".");
0051 std::string fmt = Utils::toLower(lastdot == std::string::npos ? filename : filename.substr(lastdot+1));
0052 const bool compress = (fmt == "gz");
0053 Writer& w = create();
0054 if (precision > 0) w.setPrecision(precision);
0055 w.useCompression(compress);
0056 w.write(filename, std::begin(aos), std::end(aos));
0057 }
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069 template <typename AOITER>
0070 static void write(std::ostream& stream, const AOITER& begin, const AOITER& end, int precision=-1) {
0071 create().write(stream, begin, end, precision);
0072 }
0073
0074
0075
0076
0077
0078 template <typename AOITER>
0079 static void write(const std::string& filename, const AOITER& begin, const AOITER& end, int precision=-1) {
0080 const size_t lastdot = filename.find_last_of(".");
0081 std::string fmt = Utils::toLower(lastdot == std::string::npos ? filename : filename.substr(lastdot+1));
0082 const bool compress = (fmt == "gz");
0083 Writer& w = create();
0084 if (precision > 0) w.setPrecision(precision);
0085 w.useCompression(compress);
0086 w.write(filename, begin, end);
0087 }
0088
0089