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

starting with tsoft

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: 2852
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 9f51f875
# this is <Makefile>
# ----------------------------------------------------------------------------
# $Id: Makefile,v 1.36 2008-07-08 13:37:08 tforb Exp $
# $Id: Makefile,v 1.37 2009-09-18 13:03:51 tforb Exp $
#
# Copyright (c) 2004 by Thomas Forbriger (BFO Schiltach)
#
......@@ -39,7 +39,8 @@ HEADERS=datread.h bonjer.h bonjer/readbonjer.h readany.h error.h \
pdas.h pdas/pdasread.h pdas/pdasflags.h mseed/seedstructdump.h \
sff.h mseed.h mseed/mseedread.h mseed/seedstructs.h \
hpmo.h hpmo/readhpmo.h hpmo/hpmodata.h util.h sac.h sac/sacread.h \
bytesex.h debug.h gse.h gse/gseread.h tracereader.h
bytesex.h debug.h gse.h gse/gseread.h tracereader.h \
tsoft/tsoftdata.h tsoft/tsoftreader.h tsoft.h
#SRC=misc/fortranio.cc misc/commandline.cc misc/ioswap.cc misc/error.cc \
# misc/blitzfortranio.cc hacks/hack_blitztogrepg.cc
......@@ -49,10 +50,11 @@ LIBSRC=datread.cc bonjer/bonjer.cc bonjer/readbonjer.cc readany.cc error.cc \
sff/sff.cc mseed/mseedread.cc mseed/mseed.cc mseed/seedstructs.cc \
hpmo/hpmo.cc hpmo/readhpmo.cc hpmo/hpmodata.cc \
util.cc sac/sac.cc sac/sacread.cc bytesex.cc gse/gseread.cc gse/gse.cc \
tracereader.cc
tracereader.cc \
tsoft/tsoftdata.cc tsoft/tsoftreader.cc
TESTSRC=tests/hpmotest.cc tests/pdastest.cc tests/mseedtest.cc \
tests/sfftest.cc tests/sactest.cc
tests/sfftest.cc tests/sactest.cc tests/tsofttest.cc
INCINSTALLPATH=$(LOCINCLUDEDIR)/datreadxx
LIBINSTALLPATH=$(LOCLIBDIR)
......@@ -181,7 +183,8 @@ doxyview: doxyfullview doxybrief
# test code
# ---------
sactest hpmotest mseedtest pdastest sfftest: %: tests/%.o libdatreadxx.a
sactest hpmotest mseedtest pdastest \
tsofttest sfftest: %: tests/%.o libdatreadxx.a
$(CXX) $(FLAGS) -o $@ $< -I$(LOCINCLUDEDIR) \
-ldatreadxx -lsffxx -lgsexx -ltsxx -ltfxx -laff -ltime++ \
-L$(LOCLIBDIR)
......
/*! \file tsofttest.cc
* \brief test tsoft reading
*
* ----------------------------------------------------------------------------
*
* $Id: tsofttest.cc,v 1.1 2009-09-18 13:03:51 tforb Exp $
* \author Thomas Forbriger
* \date 17/09/2009
*
* test tsoft reading
*
* Copyright (c) 2009 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 17/09/2009 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define TSOFTTEST_VERSION \
"TSOFTTEST V1.0 test tsoft reading"
#define TSOFTTEST_CVSID \
"$Id: tsofttest.cc,v 1.1 2009-09-18 13:03:51 tforb Exp $"
#include <iostream>
#include <tfxx/commandline.h>
using std::cout;
using std::cerr;
using std::endl;
int main(int iargc, char* argv[])
{
// define usage information
char usage_text[]=
{
TSOFTTEST_VERSION "\n"
"usage: tsofttest" "\n"
" or: tsofttest --help|-h" "\n"
};
// define full help text
char help_text[]=
{
TSOFTTEST_CVSID
};
// define commandline options
using namespace tfxx::cmdline;
static Declare options[]=
{
// 0: print help
{"help",arg_no,"-"},
// 1: verbose mode
{"v",arg_no,"-"},
{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; }
}
/* ----- END OF tsofttest.cc ----- */
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: tsoft.h,v 1.1 2009-09-16 16:03:24 tforb Exp $
* $Id: tsoft.h,v 1.2 2009-09-18 13:03:51 tforb Exp $
* \author Thomas Forbriger
* \date 16/09/2009
*
......@@ -18,17 +18,17 @@
*/
// include guard
#ifndef TF_TSOFT_H_VERSION
#ifndef DATREAD_TSOFT_H_VERSION
#define TF_TSOFT_H_VERSION \
"TF_TSOFT_H V1.0 "
#define TF_TSOFT_H_CVSID \
"$Id: tsoft.h,v 1.1 2009-09-16 16:03:24 tforb Exp $"
#define DATREAD_TSOFT_H_VERSION \
"DATREAD_TSOFT_H V1.0 "
#define DATREAD_TSOFT_H_CVSID \
"$Id: tsoft.h,v 1.2 2009-09-18 13:03:51 tforb Exp $"
namespace tf {
namespace datread {
}
} // namespace datread
#endif // TF_TSOFT_H_VERSION (includeguard)
#endif // DATREAD_TSOFT_H_VERSION (includeguard)
/* ----- END OF tsoft.h ----- */
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: tsoftdata.cc,v 1.1 2009-09-16 16:03:24 tforb Exp $
* $Id: tsoftdata.cc,v 1.2 2009-09-18 13:03:51 tforb Exp $
* \author Thomas Forbriger
* \date 16/09/2009
*
......@@ -16,15 +16,24 @@
*
* ============================================================================
*/
#define TF_TSOFTDATA_CC_VERSION \
"TF_TSOFTDATA_CC V1.0 "
#define TF_TSOFTDATA_CC_CVSID \
"$Id: tsoftdata.cc,v 1.1 2009-09-16 16:03:24 tforb Exp $"
#define DATREAD_TSOFTDATA_CC_VERSION \
"DATREAD_TSOFTDATA_CC V1.0 "
#define DATREAD_TSOFTDATA_CC_CVSID \
"$Id: tsoftdata.cc,v 1.2 2009-09-18 13:03:51 tforb Exp $"
#include <tsoftdata.h>
#include <datread/tsoftdata.h>
namespace tf {
namespace datread {
}
namespace tsoft {
//! read one line from data file
line::line(std::istream is): hastag(false), iscomment(false)
{
} // line::line(std::istream is)
} // namespace tsoft
} // namespace datread
/* ----- END OF tsoftdata.cc ----- */
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: tsoftdata.h,v 1.1 2009-09-16 16:03:24 tforb Exp $
* $Id: tsoftdata.h,v 1.2 2009-09-18 13:03:51 tforb Exp $
* \author Thomas Forbriger
* \date 16/09/2009
*
......@@ -18,17 +18,39 @@
*/
// include guard
#ifndef TF_TSOFTDATA_H_VERSION
#ifndef DATREAD_TSOFTDATA_H_VERSION
#define TF_TSOFTDATA_H_VERSION \
"TF_TSOFTDATA_H V1.0 "
#define TF_TSOFTDATA_H_CVSID \
"$Id: tsoftdata.h,v 1.1 2009-09-16 16:03:24 tforb Exp $"
#define DATREAD_TSOFTDATA_H_VERSION \
"DATREAD_TSOFTDATA_H V1.0 "
#define DATREAD_TSOFTDATA_H_CVSID \
"$Id: tsoftdata.h,v 1.2 2009-09-18 13:03:51 tforb Exp $"
namespace tf {
#include<iostream>
}
namespace datread {
#endif // TF_TSOFTDATA_H_VERSION (includeguard)
namespace tsoft {
//! contains one line of data file
struct line {
//! constructor: read line from file
line(std::istream is);
//! the actual line
std::string theline;
//! the tag part of the line
std::string thetag;
//! the content part of the line
std::string thecontent;
//! true if this line contains a tag
bool hastag;
//! true if this line is a comment
bool iscomment;
}; // class line
} // namespace tsoft
} // namespace datread
#endif // DATREAD_TSOFTDATA_H_VERSION (includeguard)
/* ----- END OF tsoftdata.h ----- */
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: tsoftreader.cc,v 1.1 2009-09-16 16:03:24 tforb Exp $
* $Id: tsoftreader.cc,v 1.2 2009-09-18 13:03:51 tforb Exp $
* \author Thomas Forbriger
* \date 16/09/2009
*
......@@ -16,15 +16,19 @@
*
* ============================================================================
*/
#define TF_TSOFTREADER_CC_VERSION \
"TF_TSOFTREADER_CC V1.0 "
#define TF_TSOFTREADER_CC_CVSID \
"$Id: tsoftreader.cc,v 1.1 2009-09-16 16:03:24 tforb Exp $"
#define DATREAD_TSOFTREADER_CC_VERSION \
"DATREAD_TSOFTREADER_CC V1.0 "
#define DATREAD_TSOFTREADER_CC_CVSID \
"$Id: tsoftreader.cc,v 1.2 2009-09-18 13:03:51 tforb Exp $"
#include <tsoftreader.h>
#include <datread/tsoftreader.h>
namespace tf {
namespace datread {
}
namespace tsoft {
} // namespace tsoft
} // namespace datread
/* ----- END OF tsoftreader.cc ----- */
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: tsoftreader.h,v 1.1 2009-09-16 16:03:24 tforb Exp $
* $Id: tsoftreader.h,v 1.2 2009-09-18 13:03:51 tforb Exp $
* \author Thomas Forbriger
* \date 16/09/2009
*
......@@ -18,17 +18,21 @@
*/
// include guard
#ifndef TF_TSOFTREADER_H_VERSION
#ifndef DATREAD_TSOFTREADER_H_VERSION
#define TF_TSOFTREADER_H_VERSION \
"TF_TSOFTREADER_H V1.0 "
#define TF_TSOFTREADER_H_CVSID \
"$Id: tsoftreader.h,v 1.1 2009-09-16 16:03:24 tforb Exp $"
#define DATREAD_TSOFTREADER_H_VERSION \
"DATREAD_TSOFTREADER_H V1.0 "
#define DATREAD_TSOFTREADER_H_CVSID \
"$Id: tsoftreader.h,v 1.2 2009-09-18 13:03:51 tforb Exp $"
namespace tf {
namespace datread {
}
namespace tsoft {
#endif // TF_TSOFTREADER_H_VERSION (includeguard)
} // namespace tsoft
} // namespace datread
#endif // DATREAD_TSOFTREADER_H_VERSION (includeguard)
/* ----- END OF tsoftreader.h ----- */
Supports Markdown
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