• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*---------------------------------------------------------------------------*
2  *  SemanticResult.c  *
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 #include "SR_SemanticResult.h"
21 #include "SR_SemanticResultImpl.h"
22 #include "plog.h"
23 
24 
25 //static const char* MTAG = __FILE__;
26 
27 
SR_SemanticResultGetKeyCount(SR_SemanticResult * self,size_t * count)28 ESR_ReturnCode SR_SemanticResultGetKeyCount(SR_SemanticResult* self, size_t* count)
29 {
30   if (self == NULL)
31   {
32     PLogError(L("ESR_INVALID_ARGUMENT"));
33     return ESR_INVALID_ARGUMENT;
34   }
35   return self->getKeyCount(self, count);
36 }
37 
SR_SemanticResultGetKeyList(SR_SemanticResult * self,LCHAR ** list,size_t * size)38 ESR_ReturnCode SR_SemanticResultGetKeyList(SR_SemanticResult* self, LCHAR** list, size_t* size)
39 {
40   if (self == NULL)
41   {
42     PLogError(L("ESR_INVALID_ARGUMENT"));
43     return ESR_INVALID_ARGUMENT;
44   }
45   return self->getKeyList(self, list, size);
46 }
47 
SR_SemanticResultGetValue(SR_SemanticResult * self,const LCHAR * key,LCHAR * value,size_t * len)48 ESR_ReturnCode SR_SemanticResultGetValue(SR_SemanticResult* self, const LCHAR* key, LCHAR* value, size_t* len)
49 {
50   if (self == NULL)
51   {
52     PLogError(L("ESR_INVALID_ARGUMENT"));
53     return ESR_INVALID_ARGUMENT;
54   }
55   return self->getValue(self, key, value, len);
56 }
57 
SR_SemanticResultDestroy(SR_SemanticResult * self)58 ESR_ReturnCode SR_SemanticResultDestroy(SR_SemanticResult* self)
59 {
60   if (self == NULL)
61   {
62     PLogError(L("ESR_INVALID_ARGUMENT"));
63     return ESR_INVALID_ARGUMENT;
64   }
65   return self->destroy(self);
66 }
67