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

new files and proceeding wiht hpmo

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: 1593
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent de25f169
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: readhpmo.cc,v 1.2 2004-03-31 07:53:33 tforb Exp $
* $Id: readhpmo.cc,v 1.3 2004-12-21 09:28:22 tforb Exp $
* \author Thomas Forbriger
* \date 31/03/2004
*
......@@ -19,14 +19,18 @@
#define DATREAD_READHPMO_CC_VERSION \
"DATREAD_READHPMO_CC V1.0 "
#define DATREAD_READHPMO_CC_CVSID \
"$Id: readhpmo.cc,v 1.2 2004-03-31 07:53:33 tforb Exp $"
"$Id: readhpmo.cc,v 1.3 2004-12-21 09:28:22 tforb Exp $"
#include <dateadxx/readhpmo.h>
#include <datreadxx/readhpmo.h>
namespace datread {
namespace hpmo {
void Header::readheader(std::istream& is)
{
} // Header::readheader(std::istream& is)
} // namespace hpmo
} // namespace datread
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: readhpmo.h,v 1.3 2004-12-20 16:15:39 tforb Exp $
* $Id: readhpmo.h,v 1.4 2004-12-21 09:28:22 tforb Exp $
* \author Thomas Forbriger
* \date 31/03/2004
*
......@@ -23,18 +23,33 @@
#define DATREAD_READHPMO_H_VERSION \
"DATREAD_READHPMO_H V1.0 "
#define DATREAD_READHPMO_H_CVSID \
"$Id: readhpmo.h,v 1.3 2004-12-20 16:15:39 tforb Exp $"
"$Id: readhpmo.h,v 1.4 2004-12-21 09:28:22 tforb Exp $"
#include<iostream>
#include<string>
#include<libtime++.h>
namespace datread {
namespace hpmo {
struct Header {
libtime::TAbsoluteTime time;
class Header {
public:
Header(std::istream& is) { this->readheader(is); }
void readheader(std::istream& is);
libtime::TAbsoluteTime time() const { return(Mtime); }
int errorflag() const { return(Merrorflag); }
std::string errorstring() const;
std::string headerline() const { return (Mline); }
private:
libtime::TAbsoluteTime Mtime;
int Merrorflag;
std::string Mline;
}; // struct Header
std::istream& operator >> (std::istream& is, Header& hd)
{ hd.readheader(is); }
} // namespace hpmo
} // namespace datread
......
/*! \file sac.h
* \brief read SAC files (prototypes)
*
* ----------------------------------------------------------------------------
*
* $Id: sac.h,v 1.1 2004-12-21 09:28:22 tforb Exp $
* \author Thomas Forbriger
* \date 21/12/2004
*
* read SAC files (prototypes)
*
* Copyright (c) 2004 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 21/12/2004 V1.0 Thomas Forbriger
*
* ============================================================================
*/
// include guard
#ifndef TF_SAC_H_VERSION
#define TF_SAC_H_VERSION \
"TF_SAC_H V1.0 "
#define TF_SAC_H_CVSID \
"$Id: sac.h,v 1.1 2004-12-21 09:28:22 tforb Exp $"
namespace tf {
}
#endif // TF_SAC_H_VERSION (includeguard)
/* ----- END OF sac.h ----- */
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 sac.cc
* \brief read SAC files (implementation)
*
* ----------------------------------------------------------------------------
*
* $Id: sac.cc,v 1.1 2004-12-21 09:28:23 tforb Exp $
* \author Thomas Forbriger
* \date 21/12/2004
*
* read SAC files (implementation)
*
* Copyright (c) 2004 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 21/12/2004 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define TF_SAC_CC_VERSION \
"TF_SAC_CC V1.0 "
#define TF_SAC_CC_CVSID \
"$Id: sac.cc,v 1.1 2004-12-21 09:28:23 tforb Exp $"
#include <sac.h>
namespace tf {
}
/* ----- END OF sac.cc ----- */
/*! \file sacread.cc
* \brief decode sac files (implementation)
*
* ----------------------------------------------------------------------------
*
* $Id: sacread.cc,v 1.1 2004-12-21 09:28:23 tforb Exp $
* \author Thomas Forbriger
* \date 21/12/2004
*
* decode sac files (implementation)
*
* Copyright (c) 2004 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 21/12/2004 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define TF_SACREAD_CC_VERSION \
"TF_SACREAD_CC V1.0 "
#define TF_SACREAD_CC_CVSID \
"$Id: sacread.cc,v 1.1 2004-12-21 09:28:23 tforb Exp $"
#include <sacread.h>
namespace tf {
}
/* ----- END OF sacread.cc ----- */
/*! \file sacread.h
* \brief decode sac files (prototypes)
*
* ----------------------------------------------------------------------------
*
* $Id: sacread.h,v 1.1 2004-12-21 09:28:23 tforb Exp $
* \author Thomas Forbriger
* \date 21/12/2004
*
* decode sac files (prototypes)
*
* Copyright (c) 2004 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 21/12/2004 V1.0 Thomas Forbriger
*
* ============================================================================
*/
// include guard
#ifndef TF_SACREAD_H_VERSION
#define TF_SACREAD_H_VERSION \
"TF_SACREAD_H V1.0 "
#define TF_SACREAD_H_CVSID \
"$Id: sacread.h,v 1.1 2004-12-21 09:28:23 tforb Exp $"
namespace tf {
}
#endif // TF_SACREAD_H_VERSION (includeguard)
/* ----- END OF sacread.h ----- */
/*! \file hpmotest.cc
* \brief test hpmo reading functions
*
* ----------------------------------------------------------------------------
*
* $Id: hpmotest.cc,v 1.1 2004-12-21 09:28:24 tforb Exp $
* \author Thomas Forbriger
* \date 21/12/2004
*
* test hpmo reading functions
*
* Copyright (c) 2004 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 21/12/2004 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define HPMOTEST_VERSION \
"HPMOTEST V1.0 test hpmo reading functions"
#define HPMOTEST_CVSID \
"$Id: hpmotest.cc,v 1.1 2004-12-21 09:28:24 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[]=
{
HPMOTEST_VERSION "\n"
"usage: hpmotest" "\n"
" or: hpmotest --help|-h" "\n"
};
// define full help text
char help_text[]=
{
HPMOTEST_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 hpmotest.cc ----- */
/*! \file sactest.cc
* \brief test SAC reading functions
*
* ----------------------------------------------------------------------------
*
* $Id: sactest.cc,v 1.1 2004-12-21 09:28:24 tforb Exp $
* \author Thomas Forbriger
* \date 21/12/2004
*
* test SAC reading functions
*
* Copyright (c) 2004 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 21/12/2004 V1.0 Thomas Forbriger
*
* ============================================================================
*/
#define SACTEST_VERSION \
"SACTEST V1.0 test SAC reading functions"
#define SACTEST_CVSID \
"$Id: sactest.cc,v 1.1 2004-12-21 09:28:24 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[]=
{
SACTEST_VERSION "\n"
"usage: sactest" "\n"
" or: sactest --help|-h" "\n"
};
// define full help text
char help_text[]=
{
SACTEST_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 sactest.cc ----- */
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