version  0.0.1
Defines the C++ API for MsPASS
Public Member Functions | Public Attributes | Friends | List of all members
mspass::io::MSEED_sid Class Reference

Public Member Functions

 MSEED_sid (const char *sid)
 
 MSEED_sid (const MSEED_sid &parent)
 
MSEED_sidoperator= (const MSEED_sid &parent)
 
bool operator!= (const MSEED_sid &other) const
 

Public Attributes

string net
 
string sta
 
string chan
 
string loc
 

Friends

ostream & operator<< (ostream &os, MSEED_sid &self)
 

Detailed Description

Inline class used to make a cleaner interface the ugly libmseed function for dealing with what they call an "sid".

Constructor & Destructor Documentation

◆ MSEED_sid()

mspass::io::MSEED_sid::MSEED_sid ( const char *  sid)

Constructor for this class.

Just copies c strings to std::strings in the class. Throws a simple int exception if the libmseed parser returns an error. This could be improved if I could make sense of the error logger by retrieving the message this obnoxious function posts to its error log.

79 {
80  char net[16],sta[16],loc[16],chan[16]; //larger than needed but safe
81  /* sid apparently is not const in prototype so we need this cast to
82  make it more kosher for this class */
83  if(ms_sid2nslc(const_cast<char *>(sid),net,sta,loc,chan)==0)
84  {
85  this->net = string(net);
86  this->sta = string(sta);
87  this->chan = string(chan);
88  this->loc = string(loc);
89  }
90  else
91  {
92  throw 1;
93  }
94 }

The documentation for this class was generated from the following file: