1 // Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved.
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
13 // * Neither the name of Google Inc. nor the name Chromium Embedded
14 // Framework nor the names of its contributors may be used to endorse
15 // or promote products derived from this software without specific prior
16 // written permission.
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_MULTIMAP_H_
31 #define CEF_INCLUDE_INTERNAL_CEF_STRING_MULTIMAP_H_
34 #include "include/internal/cef_export.h"
35 #include "include/internal/cef_string.h"
42 // CEF string multimaps are a set of key/value string pairs.
43 // More than one value can be assigned to a single key.
45 typedef void* cef_string_multimap_t;
48 // Allocate a new string multimap.
50 CEF_EXPORT cef_string_multimap_t cef_string_multimap_alloc();
53 // Return the number of elements in the string multimap.
55 CEF_EXPORT int cef_string_multimap_size(cef_string_multimap_t map);
58 // Return the number of values with the specified key.
60 CEF_EXPORT int cef_string_multimap_find_count(cef_string_multimap_t map,
61 const cef_string_t* key);
64 // Return the value_index-th value with the specified key.
66 CEF_EXPORT int cef_string_multimap_enumerate(cef_string_multimap_t map,
67 const cef_string_t* key,
72 // Return the key at the specified zero-based string multimap index.
74 CEF_EXPORT int cef_string_multimap_key(cef_string_multimap_t map, int index,
78 // Return the value at the specified zero-based string multimap index.
80 CEF_EXPORT int cef_string_multimap_value(cef_string_multimap_t map, int index,
84 // Append a new key/value pair at the end of the string multimap.
86 CEF_EXPORT int cef_string_multimap_append(cef_string_multimap_t map,
87 const cef_string_t* key,
88 const cef_string_t* value);
91 // Clear the string multimap.
93 CEF_EXPORT void cef_string_multimap_clear(cef_string_multimap_t map);
96 // Free the string multimap.
98 CEF_EXPORT void cef_string_multimap_free(cef_string_multimap_t map);
105 #endif // CEF_INCLUDE_INTERNAL_CEF_STRING_MULTIMAP_H_