60#include "Marshaller.h"
61#include "UnMarshaller.h"
63#include "D4StreamMarshaller.h"
64#include "D4StreamUnMarshaller.h"
73#include "InternalErr.h"
104BaseType *Str::ptr_duplicate() {
return new Str(*
this); }
106Str &Str::operator=(
const Str &rhs) {
109 BaseType::operator=(rhs);
114int Str::length()
const {
return (
int)d_buf.length(); }
116int64_t Str::length_ll()
const {
return (int64_t)d_buf.length(); }
120 DBG(cerr <<
"Entering (" << this->name() <<
" [" <<
this <<
"])" << endl);
121#if USE_LOCAL_TIMEOUT_SCHEME
127 if (ce_eval && !eval.eval_selection(dds,
dataset()))
129#if USE_LOCAL_TIMEOUT_SCHEME
134 DBG(cerr <<
"Exiting: buf = " << d_buf << endl);
147void Str::compute_checksum(Crc32 &checksum) {
148 checksum.
AddData(
reinterpret_cast<const uint8_t *
>(d_buf.data()), d_buf.length());
181 throw InternalErr(__FILE__, __LINE__,
"No place to store a reference to the data.");
186 *val =
new string(d_buf);
188 *
static_cast<string *
>(*val) = d_buf;
190 return sizeof(
string *);
208 throw InternalErr(__FILE__, __LINE__,
"NULL pointer.");
210 d_buf = *
static_cast<string *
>(val);
212 return sizeof(
string *);
230void Str::print_val(FILE *out,
string space,
bool print_decl_p) {
233 fwrite(oss.str().data(),
sizeof(
char), oss.str().length(), out);
245void Str::print_val(ostream &out,
string space,
bool print_decl_p) {
247 print_decl(out, space,
false);
254bool Str::ops(BaseType *b,
int op) {
256 if (!
read_p() && !read()) {
262 throw InternalErr(__FILE__, __LINE__,
"This value was not read!");
266 if (!b || !(b->read_p() || b->read())) {
272 throw InternalErr(__FILE__, __LINE__,
"Argument value was not read!");
293 throw Error(malformed_expr,
"Relational operators can only compare compatible types (string, number).");
299 throw Error(malformed_expr,
"Relational operators only work with scalar types.");
312 strm << DapIndent::LMarg <<
"Str::dump - (" << (
void *)
this <<
")" << endl;
314 BaseType::dump(strm);
315 strm << DapIndent::LMarg <<
"value: " << d_buf << endl;
316 DapIndent::UnIndent();
void AddData(const uint8_t *pData, const uint32_t length)
Evaluate a constraint expression.
Marshaller that knows how to marshal/serialize dap data objects to a C++ iostream using DAP4's receiv...
Read data from the stream made by D4StreamMarshaller.
A class for error processing.
A class for software fault reporting.
abstract base class used to marshal/serialize dap data objects
Holds character string data.
unsigned int buf2val(void **val) override
bool d4_ops(BaseType *b, int op) override
virtual string value() const
void dump(ostream &strm) const override
dumps information about this object
unsigned int val2buf(void *val, bool reuse=false) override
virtual bool set_value(const string &value)
virtual string esc_string_variable_value(const string &s)
Escape non-printable characters and quotes from a Str variable value. The value printed is used mostl...
abstract base class used to unmarshall/deserialize dap data objects
Holds an Internet address (URL).
top level DAP object to house generic methods
bool StrCmp(int op, T1 v1, T2 v2)
virtual bool read_p()
Has this variable been read?
virtual void print_val(FILE *out, string space="", bool print_decl_p=true)
Prints the value of the variable.
virtual string dataset() const
Returns the name of the dataset used to create this instance.