38 #define FAPIDXX_HELPER_CC_VERSION \ 39 "FAPIDXX_HELPER_CC V1.3" 53 std::string cxxstring(fstring, slen);
62 std::string::const_iterator is=s.begin();
64 for (
int i=0; i<slen; ++i)
86 string::size_type ib=s.find_first_not_of(
" ", 0);
93 string::size_type il=s.find_last_not_of(
" \r", s.length());
94 string::size_type n=il>=ib ? il-ib+1 : 0;
96 if ((ib!=0) || (n!=s.length())) { s=s.substr(ib,n); }
109 string::size_type il=s.find_last_not_of(
" \r", s.length());
110 string::size_type n=il>=0 ? il+1 : 0;
111 if (n!=s.length()) { s=s.substr(0,n); }
120 libtime::TAbsoluteTime theday(time.year(), time.month(), time.day());
121 libtime::TRelativeTime inday=time-theday;
122 return(
float(libtime::time2double(inday)));
127 libtime::TAbsoluteTime
SRCEdate(
char *date,
char* time,
132 std::string fulldate(
"");
133 fulldate+=datestring.substr(0,2);
135 fulldate+=datestring.substr(2,2);
137 fulldate+=datestring.substr(4,2);
139 fulldate+=timestring.substr(0,2);
141 fulldate+=timestring.substr(2,2);
143 fulldate+=timestring.substr(4,6);
144 libtime::TAbsoluteTime srcedate(fulldate);
154 for (
int ifline=0; ifline<*nline; ++ifline)
170 typedef sff::FREE::Tlines Tlines;
171 Tlines::const_iterator I=free.lines.begin();
173 while ((I!=free.lines.end()) && (ifline< *lindim))
175 int linelen=
static_cast<int>(I->length());
176 *lenmax= *lenmax>linelen ? *lenmax : linelen;
182 *nline=
static_cast<integer>(ifline);
sff::FREE freeblock(integer *nline, char *lines, ftnlen lines_len)
create C++ FREE block from Fortran FREE lines
long int integer
Fortran integer type.
container for WID2 data (prototypes)
libtime::TAbsoluteTime SRCEdate(char *date, char *time, ftnlen date_len, ftnlen time_len)
create appropriate time string for SRCE line
void fillfstring(const std::string &s, char *fstring, ftnlen slen)
fill a Fortran string with a C++ string
exceptions and error handling macros (prototypes)
std::string trimws(std::string s)
remove whitespace at begin and end of string
std::string trimws_end(std::string s)
remove whitespace at end of string
long int ftnlen
Fortran string size type.
std::string stringfromfstring(char *fstring, ftnlen slen)
create a C++ string from a Fortran string
float maketanf(const libtime::TAbsoluteTime &time)
create the tanf value
some helper functions (prototypes)