2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file FApp_AppResourceString.h
19 * @brief This is the header file of the _AppResourceString class.
22 #ifndef _FAPP_INTERNAL_APP_RESOURCE_STRING_H_
23 #define _FAPP_INTERNAL_APP_RESOURCE_STRING_H_
25 #include <FBaseObject.h>
26 #include <FBaseString.h>
28 namespace Tizen { namespace Base { namespace Collection { class HashMap; } } }
31 typedef _xmlDoc* xmlDocPtr;
33 namespace Tizen { namespace App
36 class _AppResourceString
37 : public Tizen::Base::Object
41 * This is the destructor for this class.
45 virtual ~_AppResourceString(void);
48 * Gets the string at the specified resource ID.
51 * @return An error code
52 * @param[in] resourceId The resource ID describing the String resource
53 * @param[out] loadedString The string obtained from the loaded application resource
54 * @exception E_SUCCESS The method was successful.
55 * @exception E_FAILURE The argument passed is not found.
56 * @exception E_INVALID_STATE The state of XML context is not in a valid state.
57 * @exception E_INVALID_ARG The argument passed to a method contains an invalid resource ID.
59 result GetString(const Tizen::Base::String resourceId, Tizen::Base::String& loadedString);
62 result Initialize(Tizen::Base::String& resourceFolder);
63 result InitializeStringInfo(Tizen::Base::String& resourceFolder);
65 static _AppResourceString* Get_AppResourceStringN(int type, const Tizen::Base::String& value = L"");
69 static bool HasSpecialString(const Tizen::Base::String& resourceStr);
70 static result ConvertToCstyleString(const Tizen::Base::String& resourceStr, Tizen::Base::String& convertedStr);
71 static xmlDocPtr ParseXmlFile(const Tizen::Base::String& path);
75 * This is the default constructor for this class.
79 _AppResourceString(void);
82 * This is the copy constructor for this class.
86 _AppResourceString(const _AppResourceString& source);
89 * This is the assignment operator for this class.
91 _AppResourceString& operator =(const _AppResourceString& source);
96 Tizen::Base::Runtime::Mutex* __pLockOfParser;
97 Tizen::Base::Collection::HashMap* __pXmlNodeMap;
99 }; // _AppResourceString
103 #endif // _FAPP_INTERNAL_APP_RESOURCE_STRING_H_