2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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.
17 * This file contains the definition of i18n dao namespace.
19 * @file i18n_dao_read_only.cpp
20 * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
22 * @brief This file contains the definition of i18n dao
25 #include <wrt-commons/i18n-dao-ro/i18n_dao_read_only.h>
26 #include <wrt-commons/i18n-dao-ro/i18n_database.h>
28 #include <orm_generator_i18n.h>
30 using namespace DPL::DB::ORM;
31 using namespace DPL::DB::ORM::i18n;
35 namespace I18nDAOReadOnly {
36 bool IsValidSubTag(const DPL::String& tag, int type)
38 I18N_DB_SELECT(select, iana_records)
39 select->Where(And(Equals<iana_records::SUBTAG>(tag),
40 Equals<iana_records::TYPE>(type)));
41 return !select->GetRowList().empty();