2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FApp_AppResourceString.h
20 * @brief This is the header file of the _AppResourceString class.
23 #ifndef _FAPP_INTERNAL_APP_RESOURCE_STRING_H_
24 #define _FAPP_INTERNAL_APP_RESOURCE_STRING_H_
26 #include <FBaseObject.h>
27 #include <FBaseString.h>
29 namespace Tizen { namespace Base { namespace Collection { class HashMap; } } }
32 typedef _xmlDoc* xmlDocPtr;
34 namespace Tizen { namespace App
37 class _AppResourceString
38 : public Tizen::Base::Object
42 * This is the destructor for this class.
46 virtual ~_AppResourceString(void);
49 * Gets the string at the specified resource ID.
52 * @return An error code
53 * @param[in] resourceId The resource ID describing the String resource
54 * @param[out] loadedString The string obtained from the loaded application resource
55 * @exception E_SUCCESS The method was successful.
56 * @exception E_FAILURE The argument passed is not found.
57 * @exception E_INVALID_STATE The state of XML context is not in a valid state.
58 * @exception E_INVALID_ARG The argument passed to a method contains an invalid resource ID.
60 result GetString(const Tizen::Base::String resourceId, Tizen::Base::String& loadedString);
63 result Initialize(Tizen::Base::String& resourceFolder);
64 result InitializeStringInfo(Tizen::Base::String& resourceFolder);
66 static _AppResourceString* Get_AppResourceStringN(int type, const Tizen::Base::String& value = L"");
70 static bool HasSpecialString(const Tizen::Base::String& resourceStr);
71 static result ConvertToCstyleString(const Tizen::Base::String& resourceStr, Tizen::Base::String& convertedStr);
72 static xmlDocPtr ParseXmlFile(const Tizen::Base::String& path);
76 * This is the default constructor for this class.
80 _AppResourceString(void);
83 * This is the copy constructor for this class.
87 _AppResourceString(const _AppResourceString& source);
90 * This is the assignment operator for this class.
92 _AppResourceString& operator =(const _AppResourceString& source);
97 Tizen::Base::Runtime::Mutex* __pLockOfParser;
98 Tizen::Base::Collection::HashMap* __pXmlNodeMap;
100 }; // _AppResourceString
104 #endif // _FAPP_INTERNAL_APP_RESOURCE_STRING_H_