uInt size_buf;
unz_file_info64 file_info;
- uLong ratio=0;
err = unzGetCurrentFileInfo64(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
if (err!=UNZ_OK)
uLong i;
unz_global_info64 gi;
int err;
- FILE* fout=NULL;
err = unzGetGlobalInfo64(uf,&gi);
if (err!=UNZ_OK)
int opt_overwrite;
const char* password;
{
- int err = UNZ_OK;
if (unzLocateFile(uf,filename,CASESENSITIVITY)!=UNZ_OK)
{
printf("file %s not found in the zipfile\n",filename);
if(pFile != NULL)
{
- int n = fseeko64(pFile, 0, SEEK_END);
+ (void)fseeko64(pFile, 0, SEEK_END);
pos = ftello64(pFile);
Atomic::ValueType Atomic::ExchangeAndAdd(ValueType value)
{
- return g_atomic_int_exchange_and_add(const_cast<gint* >(&m_value), value);
+ return g_atomic_int_add(const_cast<gint* >(&m_value), value);
}
bool Atomic::CompareAndExchange(ValueType oldValue, ValueType newValue)
//object should be copied as reference to each iframe
REFERENCE,
//object should be created for each iframe and NOT inform plugin
- CREATE_INSTANCE,
+ CREATE_INSTANCE
} class_definition_iframe_behaviour_t;
typedef enum class_definition_iframe_notice_e
ThrowMsg(DPL::Exception, DPL::GetErrnoString(error));
}
- if (0 > fprintf(m_fp.Get(), m_outputBuffer.c_str()))
+ if (m_outputBuffer.size() != fwrite(m_outputBuffer.c_str(), 1, m_outputBuffer.size(), m_fp.Get()))
{
int error = errno;
ThrowMsg(DPL::Exception, DPL::GetErrnoString(error));
WRT_DB_INSERT(insert, DeviceCapabilities, &WrtDatabase::interface())
insert->Values(row);
- deviceCapID = insert->Execute();
+ deviceCapID = static_cast<int>(insert->Execute());
}
FeatureDeviceCapProxy::Row row;
WRT_DB_INSERT(insert, PluginProperties, &WrtDatabase::interface())
insert->Values(row);
- handle = insert->Execute();
+ handle = static_cast<WrtDB::DbWidgetHandle>(insert->Execute());
LogDebug(" >> Plugin Registered. Handle: " << handle);
}
transaction.Commit();
namespace WrtDB {
namespace PropertyDAO {
-//deprecated
-void RemoveProperty(DbWidgetHandle widgetHandle,
- const PropertyDAOReadOnly::WidgetPropertyKey &key)
-{
- RemoveProperty(WidgetDAOReadOnly::getTzAppId(widgetHandle),key);
-}
void RemoveProperty(TizenAppId tzAppid,
const PropertyDAOReadOnly::WidgetPropertyKey &key)
}
}
-//deprecated
-void RegisterProperties(DbWidgetHandle widgetHandle,
- const WidgetRegisterInfo ®Info)
-{
- RegisterProperties(WidgetDAOReadOnly::getTzAppId(widgetHandle),regInfo);
-}
-
void RegisterProperties(TizenAppId tzAppid,
const WidgetRegisterInfo ®Info)
{
}
}
-//deprecated
-WidgetPropertyKeyList GetPropertyKeyList(DbWidgetHandle widgetHandle)
-{
- return GetPropertyKeyList(WidgetDAOReadOnly::getTzAppId(widgetHandle));
-}
-
WidgetPropertyKeyList GetPropertyKeyList(TizenAppId tzAppid)
{
LogDebug("Get PropertyKey list. appid: " << tzAppid);
}
}
-//deprecated
-WidgetPropertyValue GetPropertyValue(DbWidgetHandle widgetHandle,
- const WidgetPropertyKey &key)
-{
- return GetPropertyValue(WidgetDAOReadOnly::getTzAppId(widgetHandle),key);
-}
-
WidgetPropertyValue GetPropertyValue(TizenAppId tzAppid,
const WidgetPropertyKey &key)
{
{
}
-void WidgetDAO::removeProperty(
- const PropertyDAOReadOnly::WidgetPropertyKey &key)
-{
- Try {
- PropertyDAO::RemoveProperty(m_widgetHandle, key);
- }
- Catch(PropertyDAOReadOnly::Exception::ReadOnlyProperty){
- ReThrowMsg(WidgetDAO::Exception::DatabaseError,
- "Failure during removing property");
- }
-}
-
-void WidgetDAO::setProperty(
- const PropertyDAOReadOnly::WidgetPropertyKey &key,
- const PropertyDAOReadOnly::WidgetPropertyValue &value,
- bool readOnly)
-{
- Try {
- PropertyDAO::SetProperty(m_widgetHandle, key, value, readOnly);
- }
- Catch(PropertyDAOReadOnly::Exception::ReadOnlyProperty){
- ReThrowMsg(WidgetDAO::Exception::DatabaseError,
- "Failure during setting/updating property");
- }
-}
-
void WidgetDAO::setTizenAppId(const DPL::OptionalString& tzAppId)
{
SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to register widget")
}
-void WidgetDAO::registerWidget(
- WrtDB::DbWidgetHandle handle,
- const WidgetRegisterInfo &widgetRegInfo,
- const IWacSecurity &wacSecurity)
-{
- LogDebug("Registering widget");
- SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
- {
- DPL::DB::ORM::wrt::ScopedTransaction transaction(&WrtDatabase::interface());
- registerWidgetInternal(generateTizenId(), widgetRegInfo, wacSecurity, handle);
- transaction.Commit();
- }
- SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to register widget")
-}
-
DbWidgetHandle WidgetDAO::registerWidget(
const WidgetRegisterInfo &pWidgetRegisterInfo,
const IWacSecurity &wacSecurity)
widgetHandle = rand();
} while (isWidgetInstalled(widgetHandle));
- registerWidget(widgetHandle, pWidgetRegisterInfo, wacSecurity);
+ registerWidget(*pWidgetRegisterInfo.configInfo.tizenAppId, pWidgetRegisterInfo, wacSecurity);
return widgetHandle;
}
registerWidgetStartFile(widgetHandle, widgetRegInfo);
- PropertyDAO::RegisterProperties(widgetHandle, widgetRegInfo);
+ PropertyDAO::RegisterProperties(tzAppId, widgetRegInfo);
registerWidgetFeatures(widgetHandle, widgetRegInfo);
WRT_DB_INSERT(insert, wrt::WidgetIcon, &WrtDatabase::interface())
insert->Values(row);
- icon_id = insert->Execute();
+ icon_id = static_cast<int>(insert->Execute());
}
FOREACH(j, i->availableLocales)
WRT_DB_INSERT(insert, WidgetStartFile, &WrtDatabase::interface())
insert->Values(row);
- startFileID = insert->Execute();
+ startFileID = static_cast<int>(insert->Execute());
}
FOREACH(j, i->propertiesForLocales)
{
WRT_DB_INSERT(insert, wrt::WidgetFeature, &WrtDatabase::interface())
insert->Values(widgetFeature);
- widgetFeatureID = insert->Execute();
+ widgetFeatureID = static_cast<int>(insert->Execute());
}
// Insert into table FeatureParam
DPL::OptionalInt CheckPropertyReadFlag(TizenAppId tzAppid,
const WidgetPropertyKey &key);
-//deprecated
-/* This method gets widget property key list
- */
-WidgetPropertyKeyList GetPropertyKeyList(DbWidgetHandle widgetHandle)
- __attribute__((deprecated));
-
/* This method gets widget property key list
*/
WidgetPropertyKeyList GetPropertyKeyList(TizenAppId tzAppid);
*/
WidgetPreferenceList GetPropertyList(TizenAppId tzAppid);
-//deprecated
-/* This method get widget property value
- */
-WidgetPropertyValue GetPropertyValue(DbWidgetHandle widgetHandle,
- const WidgetPropertyKey &key);
-
/* This method get widget property value
*/
WidgetPropertyValue GetPropertyValue(TizenAppId tzAppid,
namespace PropertyDAO {
-//deprecated
-void RemoveProperty(DbWidgetHandle widgetHandle,
- const PropertyDAOReadOnly::WidgetPropertyKey &key)
- __attribute__((deprecated));
-
void RemoveProperty(TizenAppId tzAppid,
const PropertyDAOReadOnly::WidgetPropertyKey &key);
const PropertyDAOReadOnly::WidgetPropertyValue &value,
bool readOnly = false);
-//deprecated
-/* This method registers properties for widget.
- * Properties unregistering is done via "delete cascade" mechanism in SQL
- */
-void RegisterProperties(DbWidgetHandle widgetHandle,
- const WidgetRegisterInfo ®Info)
- __attribute__((deprecated));
-
/* This method registers properties for widget.
* Properties unregistering is done via "delete cascade" mechanism in SQL
*/
const WidgetRegisterInfo &widgetRegInfo,
const IWacSecurity &wacSecurity);
- static void registerWidget(
- WrtDB::DbWidgetHandle handle,
- const WidgetRegisterInfo &widgetRegInfo,
- const IWacSecurity &wacSecurity) __attribute__((deprecated));
-
/**
* This method removes a widget's information from EmDB.
*
using namespace WrtDB;
using namespace WrtDB::PropertyDAOReadOnly;
-// Widgets used 2000, 2001, 2002, 2003(saved by wrt_dao_tests_prepare_db.sh)
+// Widgets used "tizenid201", "tizenid202", "tizenid203", 2003(saved by wrt_dao_tests_prepare_db.sh)
#define RUNNER_ASSERT_WHAT_EQUALS(in, test) \
{std::string tmp(in); \
RUNNER_TEST(property_dao_get_lists)
{
{//property list
- std::map<WidgetHandle, size_t> prefsMap;
- prefsMap.insert(std::pair<WidgetHandle, size_t>(2000, 2));
- prefsMap.insert(std::pair<WidgetHandle, size_t>(2001, 1));
- prefsMap.insert(std::pair<WidgetHandle, size_t>(2002, 2));
- prefsMap.insert(std::pair<WidgetHandle, size_t>(1, 0)); //no widget
+ std::map<WrtDB::TizenAppId, size_t> prefsMap;
+ prefsMap.insert(std::pair<WrtDB::TizenAppId, size_t>(L"tizenid201", 2));
+ prefsMap.insert(std::pair<WrtDB::TizenAppId, size_t>(L"tizenid202", 1));
+ prefsMap.insert(std::pair<WrtDB::TizenAppId, size_t>(L"tizenid203", 2));
+ prefsMap.insert(std::pair<WrtDB::TizenAppId, size_t>(L"non_exists", 0)); //no widget
FOREACH(it, prefsMap) {
PropertyDAOReadOnly::WidgetPreferenceList prefs =
orig_2002.push_back(DPL::FromUTF8String("key1_for_2002"));
orig_2002.push_back(DPL::FromUTF8String("key2_for_2002"));
- std::map<WidgetHandle, WidgetPropertyKeyList *> prefsKeyMap;
- prefsKeyMap.insert(std::pair<WidgetHandle, WidgetPropertyKeyList *>(
- 2000, &orig_2000));
- prefsKeyMap.insert(std::pair<WidgetHandle, WidgetPropertyKeyList *>(
- 2001, &orig_2001));
- prefsKeyMap.insert(std::pair<WidgetHandle, WidgetPropertyKeyList *>(
- 2002, &orig_2002));
+ std::map<WrtDB::TizenAppId, WidgetPropertyKeyList *> prefsKeyMap;
+ prefsKeyMap.insert(std::pair<WrtDB::TizenAppId, WidgetPropertyKeyList *>(
+ L"tizenid201", &orig_2000));
+ prefsKeyMap.insert(std::pair<WrtDB::TizenAppId, WidgetPropertyKeyList *>(
+ L"tizenid202", &orig_2001));
+ prefsKeyMap.insert(std::pair<WrtDB::TizenAppId, WidgetPropertyKeyList *>(
+ L"tizenid203", &orig_2002));
FOREACH(it_out, prefsKeyMap) {
WidgetPropertyKeyList got = PropertyDAOReadOnly::GetPropertyKeyList(
*/
RUNNER_TEST(property_dao_set_update_remove)
{
- WidgetPropertyKeyList keys = PropertyDAOReadOnly::GetPropertyKeyList(2000);
+ WidgetPropertyKeyList keys = PropertyDAOReadOnly::GetPropertyKeyList(L"tizenid201");
//ADD
- PropertyDAO::SetProperty(2000,
+ PropertyDAO::SetProperty(L"tizenid201",
DPL::FromUTF8String("new_key"),
DPL::FromUTF8String("new_value1"));
RUNNER_ASSERT_MSG(
- keys.size() + 1 == PropertyDAOReadOnly::GetPropertyKeyList(2000).size(),
+ keys.size() + 1 == PropertyDAOReadOnly::GetPropertyKeyList(L"tizenid201").size(),
"new property not added");
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(
- PropertyDAOReadOnly::GetPropertyValue(2000,
+ PropertyDAOReadOnly::GetPropertyValue(L"tizenid201",
DPL::FromUTF8String("new_key")),
"new_value1");
//UPDATE
- PropertyDAO::SetProperty(2000,
+ PropertyDAO::SetProperty(L"tizenid201",
DPL::FromUTF8String("new_key"),
DPL::FromUTF8String("new_value2"));
RUNNER_ASSERT_MSG(
- keys.size() + 1 == PropertyDAOReadOnly::GetPropertyKeyList(2000).size(),
+ keys.size() + 1 == PropertyDAOReadOnly::GetPropertyKeyList(L"tizenid201").size(),
"new property not added");
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(
- PropertyDAOReadOnly::GetPropertyValue(2000,
+ PropertyDAOReadOnly::GetPropertyValue(L"tizenid201",
DPL::FromUTF8String("new_key")),
"new_value2");
//REMOVE
- PropertyDAO::RemoveProperty(2000, DPL::FromUTF8String("new_key"));
+ PropertyDAO::RemoveProperty(L"tizenid201", DPL::FromUTF8String("new_key"));
RUNNER_ASSERT_MSG(
- keys.size() == PropertyDAOReadOnly::GetPropertyKeyList(2000).size(),
+ keys.size() == PropertyDAOReadOnly::GetPropertyKeyList(L"tizenid201").size(),
"property not removed");
}
{
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(
PropertyDAOReadOnly::GetPropertyValue(
- 2000, DPL::FromUTF8String("key1_for_2000")),
+ L"tizenid201", DPL::FromUTF8String("key1_for_2000")),
"value_for_key1_2000");
RUNNER_ASSERT_WHAT_EQUALS_OPTIONAL(
PropertyDAOReadOnly::GetPropertyValue(
- 2000, DPL::FromUTF8String("key2_for_2000")),
+ L"tizenid201", DPL::FromUTF8String("key2_for_2000")),
"value_for_key2_2000");
}
virtual bool isWacSigned() const { return mWacSigned; }
virtual void getCertificateChainList(CertificateChainList& /*lst*/) const {}
virtual void getCertificateChainList(CertificateChainList& /*lst*/,
- CertificateSource source) const {}
+ CertificateSource /*source*/) const {}
WrtDB::WidgetCertificateDataList& getCertificateListRef()
{
/* Malloc result buffer */
if ((*result = (char*) malloc(nbytesdecoded + 1)) == NULL)
return 0;
- memset(*result, nbytesdecoded + 1, 0);
+ memset(*result, 0, nbytesdecoded + 1);
bufout = *result;
bufin = buffer;
)
CREATE_TABLE(TestTableJoin1)
- COLUMN_NOT_NULL(TestID, INT)
- COLUMN_NOT_NULL(TestText, TEXT)
- COLUMN(TestNumber, INT)
+ COLUMN_NOT_NULL(TestID, INT,)
+ COLUMN_NOT_NULL(TestText, TEXT,)
+ COLUMN(TestNumber, INT,)
TABLE_CONSTRAINTS(
PRIMARY KEY(TestID)
)
CREATE_TABLE_END()
CREATE_TABLE(TestTableJoin2)
- COLUMN_NOT_NULL(TestID, INT)
- COLUMN_NOT_NULL(TestText1, TEXT)
- COLUMN_NOT_NULL(TestText2, TEXT)
+ COLUMN_NOT_NULL(TestID, INT,)
+ COLUMN_NOT_NULL(TestText1, TEXT,)
+ COLUMN_NOT_NULL(TestText2, TEXT,)
TABLE_CONSTRAINTS(
PRIMARY KEY(TestID)
)
CREATE_TABLE_END()
CREATE_TABLE(TestTableJoin3)
- COLUMN_NOT_NULL(TestID, INT)
- COLUMN(Value3, INT)
- COLUMN(TestText33, TEXT)
+ COLUMN_NOT_NULL(TestID, INT,)
+ COLUMN(Value3, INT,)
+ COLUMN(TestText33, TEXT,)
TABLE_CONSTRAINTS(
PRIMARY KEY(TestID)
)
INSERT INTO TestTableJoin3 VALUES(6, 222, "test 4");
INSERT INTO TestTableJoin3 (TestID, TestText33) VALUES(7, "test 5");
INSERT INTO TestTableJoin3 (TestID, TestText33) VALUES(10, "test 6");
-)
\ No newline at end of file
+)
__LINE__,
m_message);
+ case Status::SUCCESS:
+ case Status::NONE:
default:
break;
}