2.9.1 String::SubId

The String::SubId class is used to store a sub-string identifier, or in other words a position-size pair. It has the name of an identifier because the class does not store a sub-string, but the starting position and size of a sub-string. A String::SubId has only a meaning in a reference string.


Synopsis


  #include <String.hpp>
  
  class String::SubId
  {
  public:
    ~String::SubId ();
    String::SubId ();
    String::SubId (Size position, Size length);
    String::SubId (const String::SubId& id);
    String::SubId& operator = (const SubId& id);
    Size pos () const;
    Size len () const;
    Size position () const;
    Size length () const;
  };


Description


˜String::SubId ()
Destroys this sub-string identifier, releasing all memory resources.

String::SubId ()
Constructs this sub-string identifier with default length and position set to zero.

String::SubId (Size position, Size length)
Constructs this sub-string identifier with the given position and length.

String::SubId (const String::SubId& id)
Constructs this sub-string identifier from the given identifier. All data stored in the given identifier are copied into this sub-string identifier.

String::SubId& operator = (const String::SubId& id)
Assigns the rvalue identifier to this sub-string identifier. All data stored in the rvalue identifier are copied into this sub-string identifier.

Size pos () const
Size position () const
Returns the position part stored in this sub-string identifier.

Size len () const
Size length () const
Returns the length part stored in this sub-string identifier.