1 // Copyright (c) 2009 Marshall A. Greenblatt. All rights reserved. 2 // 3 // Redistribution and use in source and binary forms, with or without 4 // modification, are permitted provided that the following conditions are 5 // met: 6 // 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 12 // distribution. 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. 17 // 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. 29 30 #ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_MAP_H_ 31 #define CEF_INCLUDE_INTERNAL_CEF_STRING_MAP_H_ 32 #pragma once 33 34 #include "include/internal/cef_export.h" 35 #include "include/internal/cef_string.h" 36 37 #ifdef __cplusplus 38 extern "C" { 39 #endif 40 41 /// 42 // CEF string maps are a set of key/value string pairs. 43 /// 44 typedef void* cef_string_map_t; 45 46 /// 47 // Allocate a new string map. 48 /// 49 CEF_EXPORT cef_string_map_t cef_string_map_alloc(); 50 51 /// 52 // Return the number of elements in the string map. 53 /// 54 CEF_EXPORT size_t cef_string_map_size(cef_string_map_t map); 55 56 /// 57 // Return the value assigned to the specified key. 58 /// 59 CEF_EXPORT int cef_string_map_find(cef_string_map_t map, 60 const cef_string_t* key, 61 cef_string_t* value); 62 63 /// 64 // Return the key at the specified zero-based string map index. 65 /// 66 CEF_EXPORT int cef_string_map_key(cef_string_map_t map, 67 size_t index, 68 cef_string_t* key); 69 70 /// 71 // Return the value at the specified zero-based string map index. 72 /// 73 CEF_EXPORT int cef_string_map_value(cef_string_map_t map, 74 size_t index, 75 cef_string_t* value); 76 77 /// 78 // Append a new key/value pair at the end of the string map. 79 /// 80 CEF_EXPORT int cef_string_map_append(cef_string_map_t map, 81 const cef_string_t* key, 82 const cef_string_t* value); 83 84 /// 85 // Clear the string map. 86 /// 87 CEF_EXPORT void cef_string_map_clear(cef_string_map_t map); 88 89 /// 90 // Free the string map. 91 /// 92 CEF_EXPORT void cef_string_map_free(cef_string_map_t map); 93 94 #ifdef __cplusplus 95 } 96 #endif 97 98 #endif // CEF_INCLUDE_INTERNAL_CEF_STRING_MAP_H_ 99