Commit 23f97906 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

proceeding

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 2986
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 668818de
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: sff.h,v 1.6 2010-02-21 12:31:33 tforb Exp $
* $Id: sff.h,v 1.7 2010-02-21 14:54:42 tforb Exp $
* \author Thomas Forbriger
* \date 11/04/2006
*
......@@ -40,7 +40,7 @@
#define DATWRITE_SFF_H_VERSION \
"TF_SFF_H V1.0 "
#define DATWRITE_SFF_H_CVSID \
"$Id: sff.h,v 1.6 2010-02-21 12:31:33 tforb Exp $"
"$Id: sff.h,v 1.7 2010-02-21 14:54:42 tforb Exp $"
#include<datwritexx/datwrite.h>
#include<datwritexx/reservoir.h>
......@@ -58,7 +58,7 @@ namespace datwrite {
*
* \ingroup sff
*/
class osffstream: public odatstream {
class osffstream: public ::datwrite::odatstream {
public:
typedef odatstream Tbase;
osffstream(std::ostream& os, const bool& debug=false);
......
This is a legacy version of the repository. It may be incomplete as well as
inconsistent. See README.history for details. For the old stock of the
repository copyright and licence conditions apply as specified for versions
commited after 2015-03-01. Use recent versions as a base for new development.
The legacy version is only stored to keep a record of history.
/*! \file writetest.cc
* \brief test writing a file
*
* ----------------------------------------------------------------------------
*
* $Id: writetest.cc,v 1.1 2010-02-21 14:54:42 tforb Exp $
* \author Thomas Forbriger
* \date 20/02/2010
*
* test writing a file
*
* Copyright (c) 2010 by Thomas Forbriger (BFO Schiltach)
*
* ----
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* ----
*
*
* REVISIONS and CHANGES
* - 20/02/2010 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define WRITETEST_VERSION \
"WRITETEST V1.0 test writing a file"
#define WRITETEST_CVSID \
"$Id: writetest.cc,v 1.1 2010-02-21 14:54:42 tforb Exp $"
#include <iostream>
#include <fstream>
#include <tfxx/commandline.h>
#include <datwritexx/sff.h>
using std::cout;
using std::cerr;
using std::endl;
struct Options {
bool verbose, debug;
bool sfftest;
std::string sfffilename;
}; // struct Options
int main(int iargc, char* argv[])
{
// define usage information
char usage_text[]=
{
WRITETEST_VERSION "\n"
"usage: writetest [-v] [-D] [-sff n]" "\n"
" or: writetest --help|-h" "\n"
};
// define full help text
char help_text[]=
{
WRITETEST_CVSID
"\n"
"-v be verbose" "\n"
"-D enter debug mode" "\n"
"-sff n write to SFF file \"n\"" "\n"
};
// define commandline options
using namespace tfxx::cmdline;
static Declare options[]=
{
// 0: print help
{"help",arg_no,"-"},
// 1: verbose mode
{"v",arg_no,"-"},
// 2: debug mode
{"D",arg_no,"-"},
// 3: verbose mode
{"sff",arg_yes,"-"},
{NULL}
};
// no arguments? print usage...
if (iargc<2)
{
cerr << usage_text << endl;
exit(0);
}
// collect options from commandline
Commandline cmdline(iargc, argv, options);
// help requested? print full help text...
if (cmdline.optset(0))
{
cerr << usage_text << endl;
cerr << help_text << endl;
exit(0);
}
/*
// dummy operation: print option settings
for (int iopt=0; iopt<2; iopt++)
{
cout << "option: '" << options[iopt].opt_string << "'" << endl;
if (cmdline.optset(iopt)) { cout << " option was set"; }
else { cout << "option was not set"; }
cout << endl;
cout << " argument (string): '" << cmdline.string_arg(iopt) << "'" << endl;
cout << " argument (int): '" << cmdline.int_arg(iopt) << "'" << endl;
cout << " argument (long): '" << cmdline.long_arg(iopt) << "'" << endl;
cout << " argument (float): '" << cmdline.float_arg(iopt) << "'" << endl;
cout << " argument (double): '" << cmdline.double_arg(iopt) << "'" << endl;
cout << " argument (bool): '";
if (cmdline.bool_arg(iopt))
{ cout << "true"; } else { cout << "false"; }
cout << "'" << endl;
}
while (cmdline.extra()) { cout << cmdline.next() << endl; }
// dummy operation: print rest of command line
while (cmdline.extra()) { cout << cmdline.next() << endl; }
*/
Options opt;
opt.verbose=cmdline.optset(1);
opt.debug=cmdline.optset(2);
opt.sfftest=cmdline.optset(3);
opt.sfffilename=cmdline.string_arg(3);
/*======================================================================*/
if (opt.sfftest)
{
if (opt.verbose)
{ cout << "SFF test: write to file " << opt.sfffilename << endl; }
std::ofstream ofs(opt.sfffilename.c_str());
datwrite::osffstream os(ofs, opt.debug);
}
}
/* ----- END OF writetest.cc ----- */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment