AFAIK the problem with "seek" is that it can't be used with some
streams, e.g. with stdin.
> So I'd prefer to leave Rigaku::load_data() empty. Now I will try to add some
> more formats. If more UXD-like formats found, I think it's
> not a bad idea to complete the
> DataSet::parse_fixedstep_file().
OK
>
> And looking forward to you comments on the committed code.
Makefile:
"chmod a+x testmain" in makefile is not necessary
usually CXX variable is used for C++ compiler, not XX
testmain.h:
* almost all function declared there are not implemented anywhere.
IMHO you can delete this file
testmain.cpp:
* "if (0 == strncmp("-i", argv[i], 2))"
most of people would put 0 on the right side. There is nothing wrong
about it, although it doesn't look natural, at least for me. I know
some books recommend "5 == foo", to prevent a typo "5 = foo", but
nowadays, in most of cases, compiler warns about such typos (i.e.
about
"if (foo = 5)").
* am I missing something, or the program, called without "-a" option,
doesn't do anything?
Anyway, it would be good to have a converting tool separated from
the rest of your test program, with option to dump also meta-data
(e.g. as #comments).
* "catch (const runtime_error e) {" -> "&e"
xylib.h,cpp:
* put declarations (and definitions) of functions that are to be used
only internally in a separate file. Together with a few functions
defined in common.h.
* i think that strtod and strtol are better (faster and usually easier
to use) than using istringstream.
other files:
I removed some not necessary 'using' statements.
I'd rather not use ds_ prefixes for files, because almost all files
will contain datasets, so there is not much information in the prefix.
Vamas file looks good.
You will get positive midterm evaluation. I'll fill the survey soon.
What next formats are you going to implement?
Marcin
--
Marcin Wojdyr | http://www.unipress.waw.pl/~wojdyr/
AFAIK the problem with "seek" is that it can't be used with some
streams, e.g. with stdin.
Makefile:
"chmod a+x testmain" in makefile is not necessary
usually CXX variable is used for C++ compiler, not XX
testmain.h:
* almost all function declared there are not implemented anywhere.
IMHO you can delete this file
testmain.cpp:
* "if (0 == strncmp("-i", argv[i], 2))"
most of people would put 0 on the right side. There is nothing wrong
about it, although it doesn't look natural, at least for me. I know
some books recommend "5 == foo", to prevent a typo "5 = foo", but
nowadays, in most of cases, compiler warns about such typos (i.e.
about
"if (foo = 5)").
* am I missing something, or the program, called without "-a" option,
doesn't do anything?
Anyway, it would be good to have a converting tool separated from
the rest of your test program, with option to dump also meta-data
(e.g. as #comments).
* "catch (const runtime_error e) {" -> "&e"
xylib.h,cpp:
* put declarations (and definitions) of functions that are to be used
only internally in a separate file. Together with a few functions
defined in common.h.
* i think that strtod and strtol are better (faster and usually easier
to use) than using istringstream.
other files:
I removed some not necessary 'using' statements.
I'd rather not use ds_ prefixes for files, because almost all files
will contain datasets, so there is not much information in the prefix.
What next formats are you going to implement?
With minor modifications, any seekable stream can be used. If one
would like to use a non-seekable stream (e.g. to take input from pipe,
or to decompress file on-the-fly, he has to either make a seekable
stream first, or remove all seek's.
> > Makefile:
> > "chmod a+x testmain" in makefile is not necessary
>
> Usually, this is not done in makefile, right? OK, I will remove this line
> from Makefile, and do it manually after make.
You don't have to do it at all, because the file should be +x without chmod.
> > testmain.h:
> > * almost all function declared there are not implemented anywhere.
> > IMHO you can delete this file
> is it needed to test all of the sample files in the "./test" dir like what I
> did in the old version? I just removed them from the old version where I did
> implement them.
It's up to you how you test it. I'd make a program that can convert
any supported file to a plain ascii file.
> > xylib.h,cpp:
> > * put declarations (and definitions) of functions that are to be used
> > only internally in a separate file. Together with a few functions
> > defined in common.h.
>
> You mean all the functions in xylib::util? Do you mean I should put their
> declarations and definations into " common.h"? Is it appropriate to put the
> function definations into a header file? Or I can put them into 2 new files:
> util.h and util.cpp
Yes, I was thinking about .h and .cpp files.
> > I'd rather not use ds_ prefixes for files, because almost all files
> > will contain datasets, so there is not much information in the prefix.
>
> I think this does not matter. This prefix can help us
> to separate the XXXDataSet
> classes with other files, e.g. xylib.cpp/h testmain.cpp/h etc.
ok
> Are you sure that we will never need a "long double"?
> If so, I will change all of them back to "double".
I'm pretty sure, I've never met this kind of data stored with a
precision greater than double.
> > What next formats are you going to implement?
> I am going to implement the Philipse udf format. And I found that this is
> also a UXD-like format. Here is a sample:
[...]
> So I will finish the parse_fixedstep_file function and apply it to all of
> the UXD-like formats.
Could you write, what arguments will this function take, and how it
will be called in these three cases? (i.e. parse_fixedstep_file(",",
.....) for file type X, etc.)