1 /*---------------------------------------------------------------------------* 2 * lstring.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 "lstring.h" 21 #include "plog.h" 22 23 #define MTAG NULL 24 25 ESR_ReturnCode LStringAppend(LString* self, const LCHAR* value) 26 { 27 if (self == NULL) 28 { 29 PLogError(L("ESR_INVALID_ARGUMENT")); 30 return ESR_INVALID_ARGUMENT; 31 } 32 return self->append(self, value); 33 } 34 35 ESR_ReturnCode LStringToLCHAR(LString* self, LCHAR** result) 36 { 37 if (self == NULL) 38 { 39 PLogError(L("ESR_INVALID_ARGUMENT")); 40 return ESR_INVALID_ARGUMENT; 41 } 42 return self->toLCHAR(self, result); 43 } 44 45 ESR_ReturnCode LStringReset(LString* self) 46 { 47 if (self == NULL) 48 { 49 PLogError(L("ESR_INVALID_ARGUMENT")); 50 return ESR_INVALID_ARGUMENT; 51 } 52 return self->reset(self); 53 } 54 55 ESR_ReturnCode LStringDestroy(LString* self) 56 { 57 if (self == NULL) 58 { 59 PLogError(L("ESR_INVALID_ARGUMENT")); 60 return ESR_INVALID_ARGUMENT; 61 } 62 return self->destroy(self); 63 } 64