SNMP++  3.3.4
OpaqueStr Class Reference

The OpaqueStr class represents the Opaque SNMP type. More...

#include <octet.h>

Inheritance diagram for OpaqueStr:
Collaboration diagram for OpaqueStr:

Public Member Functions

 OpaqueStr ()
 Constructor creating a valid zero length OpaqueStr. More...
 
 OpaqueStr (const char *str)
 Constructs a OpaqueStr with the given value. More...
 
 OpaqueStr (const unsigned char *str, unsigned long length)
 Constructs a OpaqueStr with the given value. More...
 
 OpaqueStr (const OctetStr &octet)
 Construct a OpaqueStr from an OctetStr. More...
 
 OpaqueStr (const OpaqueStr &opaque)
 Construct a OpaqueStr from another OpaqueStr. More...
 
virtual SnmpSyntaxclone () const
 Clone this object. More...
 
virtual SmiUINT32 get_syntax () const
 Return the syntax. More...
 
SnmpSyntaxoperator= (const SnmpSyntax &val)
 Map other SnmpSyntax objects to OpaqueStr. More...
 
- Public Member Functions inherited from OctetStr
 OctetStr ()
 Constructs a valid OctetStr with zero length. More...
 
 OctetStr (const char *str)
 Constructs a OctetStr with the given value. More...
 
 OctetStr (const unsigned char *str, unsigned long len)
 Constructs a OctetStr with the given value. More...
 
 OctetStr (const OctetStr &octet)
 Construct a OctetStr from another OctetStr. More...
 
 ~OctetStr ()
 Destructor, frees allocated space. More...
 
OctetStroperator= (const char *str)
 Assign a char string to a OctetStr. More...
 
OctetStroperator= (const OctetStr &octet)
 Assign a OctetStr to a OctetStr. More...
 
OctetStroperator+= (const char *a)
 Append a char string to this OctetStr. More...
 
OctetStroperator+= (const unsigned char c)
 Append a single char to this OctetStr. More...
 
OctetStroperator+= (const OctetStr &octet)
 Append another OctetStr to this OctetStr. More...
 
unsigned char & operator[] (int i)
 Allow access as if it was an array. More...
 
unsigned char operator[] (int i) const
 Allow access as if it was an array for const OctetStr objects. More...
 
int get_asn1_length () const
 Return the space needed for serialization. More...
 
bool valid () const
 Return validity of the object. More...
 
const char * get_printable () const
 Get a printable ASCII value of the string. More...
 
const char * get_printable_hex () const
 Get an ASCII formatted hex dump of the contents. More...
 
const char * get_printable_clear () const
 Get the contents with all non printable characters replaced. More...
 
void set_data (const unsigned char *str, unsigned long len)
 Set the data on an already constructed OctetStr. More...
 
unsigned long len () const
 Get the length of the string. More...
 
unsigned char * data () const
 Get a pointer to internal data. More...
 
int nCompare (const unsigned long n, const OctetStr &o) const
 
void clear ()
 Null out the contents of the string. More...
 
bool set_len (const unsigned long new_len)
 Append or shorten the internal data buffer. More...
 
- Public Member Functions inherited from SnmpSyntax
virtual ~SnmpSyntax ()
 Virtual destructor to ensure deletion of derived classes... More...
 

Additional Inherited Members

- Public Types inherited from OctetStr
enum  OutputType { OutputHexAndClear, OutputHex, OutputClear }
 Enum for setting the hex output format. More...
 
- Static Public Member Functions inherited from OctetStr
static void set_hex_output_type (const enum OutputType ot)
 Set the output format for get_pritable_hex(). More...
 
static void set_np_char (const char np)
 Set the char get_printable_hex() and get_printable_clear() will use for non printable characters. More...
 
static OctetStr from_hex_string (const OctetStr &hex_string)
 Build an OctetStr from a hex string. More...
 
static bool set_linefeed_chars (const char *lf_chars)
 Set the character for linefeeds in get_printable() functions. More...
 
- Protected Types inherited from OctetStr
enum  OutputFunction { OutputFunctionDefault, OutputFunctionHex, OutputFunctionClear }
 
- Protected Member Functions inherited from SnmpSyntax
 SnmpSyntax ()
 
- Protected Attributes inherited from OctetStr
SNMP_PP_MUTABLE char * output_buffer
 
SNMP_PP_MUTABLE unsigned int output_buffer_len
 
SNMP_PP_MUTABLE bool m_changed
 
SNMP_PP_MUTABLE enum OutputType output_last_type
 
SNMP_PP_MUTABLE char output_last_np_char
 
SNMP_PP_MUTABLE enum OutputFunction output_last_function
 
bool validity
 
- Protected Attributes inherited from SnmpSyntax
SmiVALUE smival
 
- Static Protected Attributes inherited from OctetStr
static enum OutputType hex_output_type
 
static char nonprintable_char
 
static char linefeed_chars [3]
 

Detailed Description

The OpaqueStr class represents the Opaque SNMP type.

It is derived from the SNMP++ class OctetStr and has the same interfaces and behavior, except that its syntax is sNMP_SYNTAX_OPAQUE.

Definition at line 388 of file octet.h.

Constructor & Destructor Documentation

OpaqueStr::OpaqueStr ( )
inline

Constructor creating a valid zero length OpaqueStr.

Definition at line 394 of file octet.h.

References sNMP_SYNTAX_OPAQUE.

OpaqueStr::OpaqueStr ( const char *  str)
inline

Constructs a OpaqueStr with the given value.

The OpaqueStr will be valid unless a call to new fails.

Parameters
str- Null terminated string

Definition at line 403 of file octet.h.

References sNMP_SYNTAX_OPAQUE.

OpaqueStr::OpaqueStr ( const unsigned char *  str,
unsigned long  length 
)
inline

Constructs a OpaqueStr with the given value.

The OpaqueStr will be valid unless a call to new fails.

Parameters
str- string that may contain null bytes
len- length of the string

Definition at line 413 of file octet.h.

References sNMP_SYNTAX_OPAQUE.

OpaqueStr::OpaqueStr ( const OctetStr octet)
inline

Construct a OpaqueStr from an OctetStr.

The OpaqueStr will be valid unless a call to new fails.

Parameters
octet- Value for the new object

Definition at line 422 of file octet.h.

References sNMP_SYNTAX_OPAQUE.

OpaqueStr::OpaqueStr ( const OpaqueStr opaque)
inline

Construct a OpaqueStr from another OpaqueStr.

The OpaqueStr will be valid unless a call to new fails.

Parameters
opaque- Value for the new object

Definition at line 431 of file octet.h.

References sNMP_SYNTAX_OPAQUE.

Member Function Documentation

virtual SnmpSyntax* OpaqueStr::clone ( ) const
inlinevirtual

Clone this object.

Returns
Pointer to the newly created object (allocated through new).

Reimplemented from OctetStr.

Definition at line 439 of file octet.h.

virtual SmiUINT32 OpaqueStr::get_syntax ( ) const
inlinevirtual

Return the syntax.

Returns
This method always returns sNMP_SYNTAX_OPAQUE.

Reimplemented from OctetStr.

Definition at line 446 of file octet.h.

References sNMP_SYNTAX_OPAQUE.

SnmpSyntax& OpaqueStr::operator= ( const SnmpSyntax val)
inlinevirtual

Map other SnmpSyntax objects to OpaqueStr.

Reimplemented from OctetStr.

Definition at line 451 of file octet.h.

References OctetStr::operator=().


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