ESR_Session.h

00001 /*---------------------------------------------------------------------------*
00002  *  ESR_Session.h  *
00003  *                                                                           *
00004  *  Copyright 2007 Nuance Communciations, Inc.                               *
00005  *                                                                           *
00006  *  Licensed under the Apache License, Version 2.0 (the 'License');          *
00007  *  you may not use this file except in compliance with the License.         *
00008  *                                                                           *
00009  *  You may obtain a copy of the License at                                  *
00010  *      http://www.apache.org/licenses/LICENSE-2.0                           *
00011  *                                                                           *
00012  *  Unless required by applicable law or agreed to in writing, software      *
00013  *  distributed under the License is distributed on an 'AS IS' BASIS,        *
00014  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 
00015  *  See the License for the specific language governing permissions and      *
00016  *  limitations under the License.                                           *
00017  *                                                                           *
00018  *---------------------------------------------------------------------------*/
00019 
00020 #ifndef __ESR_SESSION_H
00021 #define __ESR_SESSION_H
00022 
00023 
00024 
00025 #include "ESR_ReturnCode.h"
00026 #include "ESR_SharedPrefix.h"
00027 #include "pstdio.h"
00028 #include "ptypes.h"
00029 #include "ESR_SessionType.h"
00030 
00041 typedef struct ESR_SessionSingleton_t
00042 {
00050   ESR_ReturnCode(*getProperty)(const LCHAR* name, void** value, VariableTypes type);
00057   ESR_ReturnCode(*getPropertyType)(const LCHAR* name, VariableTypes* type);
00064   ESR_ReturnCode(*getInt)(const LCHAR* name, int* value);
00071   ESR_ReturnCode(*getUint16_t)(const LCHAR* name, asr_uint16_t* value);
00078   ESR_ReturnCode(*getSize_t)(const LCHAR* name, size_t* value);
00085   ESR_ReturnCode(*getFloat)(const LCHAR* name, float* value);
00092   ESR_ReturnCode(*getBool)(const LCHAR* name, ESR_BOOL* value);
00101   ESR_ReturnCode(*getLCHAR)(const LCHAR* name, LCHAR* value, size_t* len);
00108   ESR_ReturnCode(*contains)(const LCHAR* name, ESR_BOOL* exists);
00116   ESR_ReturnCode(*setProperty)(const LCHAR* name, void* value, VariableTypes type);
00123   ESR_ReturnCode(*setInt)(const LCHAR* name, int value);
00130   ESR_ReturnCode(*setUint16_t)(const LCHAR* name, asr_uint16_t value);
00137   ESR_ReturnCode(*setSize_t)(const LCHAR* name, size_t value);
00144   ESR_ReturnCode(*setFloat)(const LCHAR* name, float value);
00151   ESR_ReturnCode(*setBool)(const LCHAR* name, ESR_BOOL value);
00158   ESR_ReturnCode(*setLCHAR)(const LCHAR* name, LCHAR* value);
00168   ESR_ReturnCode(*setIntIfEmpty)(const LCHAR* name, int value);
00178   ESR_ReturnCode(*setUint16_tIfEmpty)(const LCHAR* name, asr_uint16_t value);
00188   ESR_ReturnCode(*setSize_tIfEmpty)(const LCHAR* name, size_t value);
00198   ESR_ReturnCode(*setFloatIfEmpty)(const LCHAR* name, float value);
00208   ESR_ReturnCode(*setBoolIfEmpty)(const LCHAR* name, ESR_BOOL value);
00218   ESR_ReturnCode(*setLCHARIfEmpty)(const LCHAR* name, LCHAR* value);
00224   ESR_ReturnCode(*removeProperty)(const LCHAR* name);
00230   ESR_ReturnCode(*removeAndFreeProperty)(const LCHAR* name);
00250   ESR_ReturnCode(*importCommandLine)(int argc, char* argv[]);
00256   ESR_ReturnCode(*getSize)(size_t* size);
00263   ESR_ReturnCode(*getKeyAtIndex)(size_t index, LCHAR** key);
00269   ESR_ReturnCode(*convertToInt)(const LCHAR* key);
00275   ESR_ReturnCode(*convertToUint16_t)(const LCHAR* key);
00276   
00282   ESR_ReturnCode(*convertToSize_t)(const LCHAR* key);
00283   
00289   ESR_ReturnCode(*convertToFloat)(const LCHAR* key);
00290   
00296   ESR_ReturnCode(*convertToBool)(const LCHAR* key);
00300   ESR_ReturnCode(*destroy)(void);
00306   ESR_ReturnCode(*importParFile)(const LCHAR* filename);
00312   ESR_ReturnCode(*importArgFile)(const LCHAR* filename);
00313   
00317   void* data;
00318 }
00319 ESR_SessionSingleton;
00320 
00328 ESR_SHARED_API ESR_ReturnCode ESR_SessionCreate(const LCHAR* filename);
00337 ESR_SHARED_API ESR_ReturnCode ESR_SessionGetProperty(const LCHAR* name, void** value,
00338     VariableTypes type);
00346 ESR_SHARED_API ESR_ReturnCode ESR_SessionGetInt(const LCHAR* name, int* value);
00354 ESR_SHARED_API ESR_ReturnCode ESR_SessionGetUint16_t(const LCHAR* name, asr_uint16_t* value);
00362 ESR_SHARED_API ESR_ReturnCode ESR_SessionGetSize_t(const LCHAR* name, size_t* value);
00370 ESR_SHARED_API ESR_ReturnCode ESR_SessionGetFloat(const LCHAR* name, float* value);
00378 ESR_SHARED_API ESR_ReturnCode ESR_SessionGetBool(const LCHAR* name, ESR_BOOL* value);
00388 ESR_SHARED_API ESR_ReturnCode ESR_SessionGetLCHAR(const LCHAR* name, LCHAR* value, size_t* len);
00396 ESR_SHARED_API ESR_ReturnCode ESR_SessionContains(const LCHAR* name, ESR_BOOL* exists);
00405 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetProperty(const LCHAR* name, void* value,
00406     VariableTypes type);
00414 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetInt(const LCHAR* name, int value);
00422 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetUint16_t(const LCHAR* name, asr_uint16_t value);
00430 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetSize_t(const LCHAR* name, size_t value);
00438 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetFloat(const LCHAR* name, float value);
00446 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetBool(const LCHAR* name, ESR_BOOL value);
00454 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetLCHAR(const LCHAR* name, LCHAR* value);
00462 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetIntIfEmpty(const LCHAR* name, int value);
00470 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetUint16_tIfEmpty(const LCHAR* name, asr_uint16_t value);
00478 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetSize_tIfEmpty(const LCHAR* name, size_t value);
00486 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetFloatIfEmpty(const LCHAR* name, float value);
00494 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetBoolIfEmpty(const LCHAR* name, ESR_BOOL value);
00502 ESR_SHARED_API ESR_ReturnCode ESR_SessionSetLCHARIfEmpty(const LCHAR* name, LCHAR* value);
00509 ESR_SHARED_API ESR_ReturnCode ESR_SessionRemoveProperty(const LCHAR* name);
00516 ESR_SHARED_API ESR_ReturnCode ESR_SessionRemoveAndFreeProperty(const LCHAR* name);
00522 ESR_SHARED_API ESR_ReturnCode ESR_SessionDestroy(void);
00543 ESR_SHARED_API ESR_ReturnCode ESR_SessionImportCommandLine(int argc, LCHAR* argv[]);
00544 
00551 ESR_SHARED_API ESR_ReturnCode ESR_SessionGetSize(size_t* size);
00552 
00560 ESR_SHARED_API ESR_ReturnCode ESR_SessionGetKeyAtIndex(size_t index, LCHAR** key);
00561 
00569 ESR_SHARED_API ESR_ReturnCode ESR_SessionConvertToInt(const LCHAR* key);
00570 
00578 ESR_SHARED_API ESR_ReturnCode ESR_SessionConvertToUint16_t(const LCHAR* key);
00579 
00587 ESR_SHARED_API ESR_ReturnCode ESR_SessionConvertToSize_t(const LCHAR* key);
00588 
00596 ESR_SHARED_API ESR_ReturnCode ESR_SessionConvertToFloat(const LCHAR* key);
00597 
00605 ESR_SHARED_API ESR_ReturnCode ESR_SessionConvertToBool(const LCHAR* key);
00613 ESR_SHARED_API ESR_ReturnCode ESR_SessionGetPropertyType(const LCHAR* name, VariableTypes* type);
00621 ESR_SHARED_API ESR_ReturnCode ESR_SessionImportParFile(const LCHAR* filename);
00628 ESR_SHARED_API ESR_ReturnCode ESR_SessionExists(ESR_BOOL* val);
00639 ESR_SHARED_API ESR_ReturnCode ESR_SessionPrefixWithBaseDirectory(LCHAR* path, size_t* len);
00647 ESR_SHARED_API ESR_ReturnCode ESR_SessionAddListener(ESR_SessionType* self, ESR_SessionTypeListenerPair* listener);
00648 
00656 ESR_SHARED_API ESR_ReturnCode ESR_SessionRemoveListener(ESR_SessionType* self, ESR_SessionTypeListenerPair* listener);
00657 
00658 
00659 
00666 #endif /* __ESR_SESSION_H */

Generated on Thu May 1 15:37:25 2008 for SREC by  doxygen 1.5.3