1 /*---------------------------------------------------------------------------* 2 * ESR_SessionImpl.h * 3 * * 4 * Copyright 2007, 2008 Nuance Communciations, Inc. * 5 * * 6 * Licensed under the Apache License, Version 2.0 (the 'License'); * 7 * you may not use this file except in compliance with the License. * 8 * * 9 * You may obtain a copy of the License at * 10 * http://www.apache.org/licenses/LICENSE-2.0 * 11 * * 12 * Unless required by applicable law or agreed to in writing, software * 13 * distributed under the License is distributed on an 'AS IS' BASIS, * 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 15 * See the License for the specific language governing permissions and * 16 * limitations under the License. * 17 * * 18 *---------------------------------------------------------------------------*/ 19 20 #ifndef __ESR_SESSIONIMPL_H 21 #define __ESR_SESSIONIMPL_H 22 23 24 25 #include "ESR_ReturnCode.h" 26 #include "ESR_Session.h" 27 #include "ESR_SharedPrefix.h" 28 #include "HashMap.h" 29 #include "pstdio.h" 30 31 /** 32 * Default implementation. 33 */ 34 ESR_SHARED_API ESR_ReturnCode ESR_SessionGetPropertyImpl(ESR_SessionType* self, 35 const LCHAR* name, 36 void** value, 37 VariableTypes type); 38 /** 39 * Default implementation. 40 */ 41 ESR_SHARED_API ESR_ReturnCode ESR_SessionGetIntImpl(ESR_SessionType* self, 42 const LCHAR* name, 43 int* value); 44 /** 45 * Default implementation. 46 */ 47 ESR_SHARED_API ESR_ReturnCode ESR_SessionGetSize_tImpl(ESR_SessionType* self, 48 const LCHAR* name, 49 size_t* value); 50 /** 51 * Default implementation. 52 */ 53 ESR_SHARED_API ESR_ReturnCode ESR_SessionGetFloatImpl(ESR_SessionType* self, 54 const LCHAR* name, 55 float* value); 56 /** 57 * Default implementation. 58 */ 59 ESR_SHARED_API ESR_ReturnCode ESR_SessionGetBoolImpl(ESR_SessionType* self, 60 const LCHAR* name, 61 ESR_BOOL* value); 62 /** 63 * Default implementation. 64 */ 65 ESR_SHARED_API ESR_ReturnCode ESR_SessionGetLCHARImpl(ESR_SessionType* self, 66 const LCHAR* name, 67 LCHAR* value, size_t* len); 68 /** 69 * Default implementation. 70 */ 71 ESR_SHARED_API ESR_ReturnCode ESR_SessionContainsImpl(ESR_SessionType* self, 72 const LCHAR* name, 73 ESR_BOOL* exists); 74 /** 75 * Default implementation. 76 */ 77 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetPropertyImpl(ESR_SessionType* self, 78 const LCHAR* name, 79 void* value, 80 VariableTypes type); 81 /** 82 * Default implementation. 83 */ 84 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetIntImpl(ESR_SessionType* self, 85 const LCHAR* name, 86 int value); 87 /** 88 * Default implementation. 89 */ 90 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetSize_tImpl(ESR_SessionType* self, 91 const LCHAR* name, 92 size_t value); 93 /** 94 * Default implementation. 95 */ 96 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetFloatImpl(ESR_SessionType* self, 97 const LCHAR* name, 98 float value); 99 /** 100 * Default implementation. 101 */ 102 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetBoolImpl(ESR_SessionType* self, 103 const LCHAR* name, 104 ESR_BOOL value); 105 /** 106 * Default implementation. 107 */ 108 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetLCHARImpl(ESR_SessionType* self, 109 const LCHAR* name, 110 LCHAR* value); 111 /** 112 * Default implementation. 113 */ 114 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetIntIfEmptyImpl(ESR_SessionType* self, 115 const LCHAR* name, 116 int value); 117 /** 118 * Default implementation. 119 */ 120 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetSize_tIfEmptyImpl(ESR_SessionType* self, 121 const LCHAR* name, 122 size_t value); 123 /** 124 * Default implementation. 125 */ 126 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetFloatIfEmptyImpl(ESR_SessionType* self, 127 const LCHAR* name, 128 float value); 129 /** 130 * Default implementation. 131 */ 132 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetBoolIfEmptyImpl(ESR_SessionType* self, 133 const LCHAR* name, 134 ESR_BOOL value); 135 /** 136 * Default implementation. 137 */ 138 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetLCHARIfEmptyImpl(ESR_SessionType* self, 139 const LCHAR* name, 140 LCHAR* value); 141 /** 142 * Default implementation. 143 */ 144 ESR_SHARED_API ESR_ReturnCode ESR_SessionRemovePropertyImpl(ESR_SessionType* self, 145 const LCHAR* name); 146 /** 147 * Default implementation. 148 */ 149 ESR_SHARED_API ESR_ReturnCode ESR_SessionImportCommandLineImpl(ESR_SessionType* self, 150 int argc, 151 LCHAR* argv[]); 152 /** 153 * Default implementation. 154 */ 155 ESR_SHARED_API ESR_ReturnCode ESR_SessionImportSessionImpl(ESR_SessionType* self, 156 ESR_SessionType* source); 157 /** 158 * Default implementation. 159 */ 160 ESR_SHARED_API ESR_ReturnCode ESR_SessionGetSizeImpl(ESR_SessionType* self, 161 size_t* size); 162 /** 163 * Default implementation. 164 */ 165 ESR_SHARED_API ESR_ReturnCode ESR_SessionGetKeyAtIndexImpl(ESR_SessionType* self, 166 size_t index, 167 LCHAR** key); 168 /** 169 * Default implementation. 170 */ 171 ESR_SHARED_API ESR_ReturnCode ESR_SessionDestroyImpl(ESR_SessionType* self); 172 /** 173 * Default implementation. 174 */ 175 ESR_SHARED_API ESR_ReturnCode ESR_SessionConvertToIntImpl(ESR_SessionType* self, 176 const LCHAR* key); 177 /** 178 * Default implementation. 179 */ 180 ESR_SHARED_API ESR_ReturnCode ESR_SessionConvertToSize_tImpl(ESR_SessionType* self, 181 const LCHAR* key); 182 /** 183 * Default implementation. 184 */ 185 ESR_SHARED_API ESR_ReturnCode ESR_SessionConvertToFloatImpl(ESR_SessionType* self, 186 const LCHAR* key); 187 /** 188 * Default implementation. 189 */ 190 ESR_SHARED_API ESR_ReturnCode ESR_SessionConvertToBoolImpl(ESR_SessionType* self, 191 const LCHAR* key); 192 /** 193 * Default implementation. 194 */ 195 ESR_SHARED_API ESR_ReturnCode ESR_SessionGetPropertyTypeImpl(ESR_SessionType* self, 196 const LCHAR* name, 197 VariableTypes* type); 198 /** 199 * Default implementation. 200 */ 201 ESR_SHARED_API ESR_ReturnCode ESR_SessionImportParFileImpl(ESR_SessionType* self, 202 const LCHAR* filename); 203 204 /** 205 * Default implementation. 206 */ 207 ESR_SHARED_API ESR_ReturnCode ESR_SessionExists(ESR_BOOL* val); 208 209 210 #endif /* __ESR_SESSIONIMPL_H */ 211