Commit b4c01e7f authored by ml's avatar ml

*** empty log message ***

parent 3f1bece2
......@@ -4,6 +4,9 @@
#include "wb_attrname.h"
#include "pwr.h"
static const char* s_emptyString = "";
wb_attribute::wb_attribute() : wb_status(LDH__NOSUCHATTR), m_orep(0), m_adrep(0),
m_size(0), m_offset(0), m_tid(0), m_elements(0),
......@@ -48,8 +51,9 @@ wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep * const orep, wb_adrep * con
m_adrep->ref();
m_size = m_adrep->size();
m_offset = m_adrep->offset();
m_type = m_adrep->type();
m_tid = m_adrep->tid();
m_elements = m_adrep->nElement();
m_type = m_adrep->type();
m_flags = m_adrep->flags();
}
else {
......@@ -142,6 +146,7 @@ wb_attribute& wb_attribute::operator=(const wb_attribute& x)
m_size = x.m_size;
m_offset = x.m_offset;
m_tid = x.m_tid;
m_elements = x.m_elements;
m_type = x.m_type;
m_flags = x.m_flags;
return *this;
......@@ -299,16 +304,20 @@ wb_attribute wb_attribute::prev()
return a;
}
wb_name wb_attribute::name()
const char* wb_attribute::name() const
{
wb_name n;
return n;
if (m_adrep)
return m_adrep->name();
else
return s_emptyString;
}
wb_name wb_attribute::name(ldh_eName type)
wb_name wb_attribute::longName()
{
wb_name n;
return n;
if (m_adrep)
return m_adrep->longName();
else
return wb_name();
}
void wb_attribute::name(const char *name)
......
......@@ -84,8 +84,8 @@ public:
wb_attribute prev();
wb_name name(); // get attribute name
wb_name name(ldh_eName type);
const char* name() const; // get attribute name
wb_name longName();
void name(const char *name);
void name(wb_name *name);
......
#include "wb_name.h"
const char* wb_name::m_emptyString = "";
wb_name::wb_name( const char *name)
{
......
......@@ -97,7 +97,7 @@ class wb_name : public wb_status
{
protected:
wb_nrep *m_nrep;
static const char* m_emptyString;
public:
wb_name() : wb_status(LDH__NONAME), m_nrep(0) {}
......@@ -107,7 +107,7 @@ public:
~wb_name();
const char* c_str() const { return m_nrep->name();}
const char* c_str() const;
wb_name& operator=(const wb_name& n);
......@@ -158,6 +158,23 @@ public:
void check() const { if ( evenSts()) throw wb_error(m_sts);}
};
inline const char* wb_name::c_str() const
{
if (m_nrep == 0)
return m_emptyString;
else
return m_nrep->name();
}
inline ostream& operator<< (ostream& os, const wb_name& name)
{
return os << name.c_str();
}
#endif
......
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