#include "string_multi_map.h"
Public Member Functions | |
bool | empty () |
void | Clear () |
int | num_names () const |
Returns the number of distinct names. | |
int | num_values () const |
bool | Lookup (const StringPiece &name, ConstStringStarVector *values) const |
bool | Has (const StringPiece &name) const |
bool | RemoveAll (const StringPiece &var_name) |
Remove all variables by name. Returns true if anything was removed. | |
const char * | name (int index) const |
const GoogleString * | value (int index) const |
Note that the value can be NULL. | |
void | Add (const StringPiece &var_name, const StringPiece &value) |
Add a new variable. The value can be null. | |
void | CopyFrom (const StringMultiMap &string_multi_map) |
Implements an ordered string map, providing case-sensitive and case insensitive versions. The order of insertion is retained and names/value pairs can be accessed by index or looked up by name.
bool net_instaweb::StringMultiMap< StringCompare >::Lookup | ( | const StringPiece & | name, | |
ConstStringStarVector * | values | |||
) | const [inline] |
Find the value(s) associated with a variable. Note that you may specify a variable multiple times by calling Add multiple times with the same variable, and each of these values will be returned in the vector.
int net_instaweb::StringMultiMap< StringCompare >::num_values | ( | ) | const [inline] |
Returns the number of distinct values, which can be larger than num_names if Add is called twice with the same name.
bool net_instaweb::StringMultiMap< StringCompare >::RemoveAll | ( | const StringPiece & | var_name | ) | [inline] |
Remove all variables by name. Returns true if anything was removed.
< Temp variable for new vector.
Note: we have to erase from the map second, because map owns the name.