structures::string_array Class Reference

An array of strings with some additional helpful methods. More...

#include <string_array.h>

Inheritance diagram for structures::string_array:
Inheritance graph
[legend]
Collaboration diagram for structures::string_array:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 string_array (int number=0, const basis::astring *initial_contents=NIL)
 Constructs an array of "number" strings.
 string_array (int number, const char *initial_contents[])
 a constructor that operates on an array of char pointers.
 string_array (const basis::array< basis::astring > &to_copy)
 copy constructor that takes a templated array of astring.
 DEFINE_CLASS_NAME ("string_array")
basis::astring text_format (const basis::astring &separator=",", const basis::astring &delimiter="\"") const
 Prints out a formatted view of the contained strings and returns it.
basis::astring text_form () const
 A synonym for the text_format() method.
bool equal_to (const equalizable &to_compare) const
 Compares this string array for equality with "to_compare".
int find (const basis::astring &to_find) const
 locates string specified and returns its index, or negative if missing.
bool prefix_compare (const string_array &second) const
 Returns true if all of the elements in this are the same in "second".
virtual void pack (basis::byte_array &packed_form) const
 Packs this string array into the "packed_form" byte array.
virtual bool unpack (basis::byte_array &packed_form)
 Unpacks a string array from the "packed_form" byte array.
virtual int packed_size () const
 Returns the number of bytes this string array would consume if packed.

Detailed Description

An array of strings with some additional helpful methods.

Definition at line 28 of file string_array.h.


Constructor & Destructor Documentation

structures::string_array::string_array ( int  number = 0,
const basis::astring initial_contents = NIL 
) [inline]

Constructs an array of "number" strings.

creates a list of strings based on an initial "number" of entries and some "initial_contents", which should be a regular C array of astrings with at least as many entries as "number".

Definition at line 34 of file string_array.h.

structures::string_array::string_array ( int  number,
const char *  initial_contents[] 
) [inline]

a constructor that operates on an array of char pointers.

be very careful with the array to ensure that the right number of elements is provided.

Definition at line 44 of file string_array.h.

structures::string_array::string_array ( const basis::array< basis::astring > &  to_copy  )  [inline]

copy constructor that takes a templated array of astring.

Definition at line 51 of file string_array.h.


Member Function Documentation

structures::string_array::DEFINE_CLASS_NAME ( "string_array"   ) 
bool structures::string_array::equal_to ( const equalizable &  to_compare  )  const [inline]

Compares this string array for equality with "to_compare".

Definition at line 77 of file string_array.h.

int structures::string_array::find ( const basis::astring to_find  )  const [inline]

locates string specified and returns its index, or negative if missing.

Definition at line 88 of file string_array.h.

Referenced by versions::version_ini::write_assembly().

virtual void structures::string_array::pack ( basis::byte_array packed_form  )  const [inline, virtual]

Packs this string array into the "packed_form" byte array.

Implements basis::packable.

Definition at line 107 of file string_array.h.

Referenced by octopi::unhandled_request::pack(), structures::version::pack(), and octopi::file_transfer_infoton::package_tree_info().

virtual int structures::string_array::packed_size (  )  const [inline, virtual]

Returns the number of bytes this string array would consume if packed.

Implements basis::packable.

Definition at line 115 of file string_array.h.

Referenced by octopi::infoton::fast_pack_overhead(), octopi::unhandled_request::packed_size(), and structures::version::packed_size().

bool structures::string_array::prefix_compare ( const string_array second  )  const [inline]

Returns true if all of the elements in this are the same in "second".

The array "second" can have more elements, but must have all of the items listed in this string array.

Definition at line 98 of file string_array.h.

Referenced by octopi::octopus::evaluate(), and synchronic::list_synchronizer::update().

basis::astring structures::string_array::text_form (  )  const [inline]
basis::astring structures::string_array::text_format ( const basis::astring separator = ",",
const basis::astring delimiter = "\"" 
) const [inline]

Prints out a formatted view of the contained strings and returns it.

Definition at line 58 of file string_array.h.

Referenced by text_form().

virtual bool structures::string_array::unpack ( basis::byte_array packed_form  )  [inline, virtual]

Unpacks a string array from the "packed_form" byte array.

Implements basis::packable.

Definition at line 111 of file string_array.h.

Referenced by octopi::unhandled_request::unpack(), and structures::version::unpack().


The documentation for this class was generated from the following file:
Generated on Sat Jan 28 04:25:59 2012 for hoople2 project by  doxygen 1.6.3