Changeset 11211 for trunk/FACT++/src
- Timestamp:
- 06/29/11 15:25:22 (13 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Converter.cc
r11041 r11211 925 925 } 926 926 927 vector<string> Converter::ToStrings(const void *src/*, size_t size*/) const 928 { 929 const char *charSrc = static_cast<const char*>(src); 930 931 vector<string> rc; 932 933 for (Converter::FormatList::const_iterator i=fList.begin(); i!=fList.end(); i++) 934 { 935 /* 936 if (charSrc-size>src) 937 { 938 ostringstream err; 939 err << "Format description [fmt=" << fFormat << "] exceeds available data size (" << size << ")"; 940 throw runtime_error(err.str()); 941 }*/ 942 943 const char type = i->first.first->name()[0]; 944 if (type=='v') 945 break; 946 947 if (type=='S') 948 { 949 const string str(charSrc); 950 rc.push_back(str); 951 charSrc += str.length()+1; 952 continue; 953 } 954 955 // string types 956 //if (string("bsilfdxc").find_first_of(type)==string::npos) 957 // throw runtime_error(string("Type '")+type+"' not supported converting to FITS."); 958 959 const int s = i->first.second; // size of element 960 const int n = i->second.first; // number of elements 961 962 charSrc += s*n; 963 } 964 965 return rc; 966 967 /* 968 if (charSrc-size!=src) 969 { 970 ostringstream err; 971 err << "Data block size (" << size << ") doesn't fit format description [fmt=" << fFormat << "]"; 972 throw runtime_error(err.str()); 973 }*/ 974 } 975 927 976 vector<char> Converter::ToFits(const void *src, size_t size) const 928 977 { -
trunk/FACT++/src/Converter.h
r10746 r11211 96 96 std::vector<char> GetVector(const std::string &str) const; 97 97 98 std::vector<std::string> ToStrings(const void *src/*, size_t size*/) const; 98 99 void ToFits(void* dest, const void* src, size_t size) const; 99 100
Note:
See TracChangeset
for help on using the changeset viewer.