convert RegError to scoped enum
Change-Id: I55977c38578cb59deb195d91f8948da2e0905b6a
This commit is contained in:
@@ -1452,10 +1452,10 @@ void cppuhelper::ServiceManager::readRdbFile(
|
||||
bool cppuhelper::ServiceManager::readLegacyRdbFile(rtl::OUString const & uri) {
|
||||
Registry reg;
|
||||
switch (reg.open(uri, RegAccessMode::READONLY)) {
|
||||
case REG_NO_ERROR:
|
||||
case RegError::NO_ERROR:
|
||||
break;
|
||||
case REG_REGISTRY_NOT_EXISTS:
|
||||
case REG_INVALID_REGISTRY:
|
||||
case RegError::REGISTRY_NOT_EXISTS:
|
||||
case RegError::INVALID_REGISTRY:
|
||||
{
|
||||
// Ignore empty rdb files (which are at least seen by subordinate
|
||||
// uno processes during extension registration; Registry::open can
|
||||
@@ -1475,16 +1475,16 @@ bool cppuhelper::ServiceManager::readLegacyRdbFile(rtl::OUString const & uri) {
|
||||
return false;
|
||||
}
|
||||
RegistryKey rootKey;
|
||||
if (reg.openRootKey(rootKey) != REG_NO_ERROR) {
|
||||
if (reg.openRootKey(rootKey) != RegError::NO_ERROR) {
|
||||
throw css::uno::DeploymentException(
|
||||
"Failure reading legacy rdb file " + uri,
|
||||
static_cast< cppu::OWeakObject * >(this));
|
||||
}
|
||||
RegistryKeyArray impls;
|
||||
switch (rootKey.openSubKeys("IMPLEMENTATIONS", impls)) {
|
||||
case REG_NO_ERROR:
|
||||
case RegError::NO_ERROR:
|
||||
break;
|
||||
case REG_KEY_NOT_EXISTS:
|
||||
case RegError::KEY_NOT_EXISTS:
|
||||
return true;
|
||||
default:
|
||||
throw css::uno::DeploymentException(
|
||||
@@ -1534,8 +1534,8 @@ rtl::OUString cppuhelper::ServiceManager::readLegacyRdbString(
|
||||
RegistryKey subkey;
|
||||
RegValueType t;
|
||||
sal_uInt32 s(0);
|
||||
if (key.openKey(path, subkey) != REG_NO_ERROR
|
||||
|| subkey.getValueInfo(rtl::OUString(), &t, &s) != REG_NO_ERROR
|
||||
if (key.openKey(path, subkey) != RegError::NO_ERROR
|
||||
|| subkey.getValueInfo(rtl::OUString(), &t, &s) != RegError::NO_ERROR
|
||||
|| t != RegValueType::STRING
|
||||
|| s == 0 || s > static_cast< sal_uInt32 >(SAL_MAX_INT32))
|
||||
{
|
||||
@@ -1545,7 +1545,7 @@ rtl::OUString cppuhelper::ServiceManager::readLegacyRdbString(
|
||||
}
|
||||
rtl::OUString val;
|
||||
std::vector< char > v(s); // assuming sal_uInt32 fits into vector::size_type
|
||||
if (subkey.getValue(rtl::OUString(), &v[0]) != REG_NO_ERROR
|
||||
if (subkey.getValue(rtl::OUString(), &v[0]) != RegError::NO_ERROR
|
||||
|| v.back() != '\0'
|
||||
|| !rtl_convertStringToUString(
|
||||
&val.pData, &v[0], static_cast< sal_Int32 >(s - 1),
|
||||
@@ -1568,9 +1568,9 @@ void cppuhelper::ServiceManager::readLegacyRdbStrings(
|
||||
assert(strings != 0);
|
||||
RegistryKey subkey;
|
||||
switch (key.openKey(path, subkey)) {
|
||||
case REG_NO_ERROR:
|
||||
case RegError::NO_ERROR:
|
||||
break;
|
||||
case REG_KEY_NOT_EXISTS:
|
||||
case RegError::KEY_NOT_EXISTS:
|
||||
return;
|
||||
default:
|
||||
throw css::uno::DeploymentException(
|
||||
@@ -1579,7 +1579,7 @@ void cppuhelper::ServiceManager::readLegacyRdbStrings(
|
||||
}
|
||||
rtl::OUString prefix(subkey.getName() + "/");
|
||||
RegistryKeyNames names;
|
||||
if (subkey.getKeyNames(rtl::OUString(), names) != REG_NO_ERROR) {
|
||||
if (subkey.getKeyNames(rtl::OUString(), names) != RegError::NO_ERROR) {
|
||||
throw css::uno::DeploymentException(
|
||||
"Failure reading legacy rdb file " + uri,
|
||||
static_cast< cppu::OWeakObject * >(this));
|
||||
|
@@ -43,7 +43,7 @@ bool AstModule::dump(RegistryKey& rKey)
|
||||
localKey = rKey;
|
||||
}else
|
||||
{
|
||||
if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey))
|
||||
if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey) != RegError::NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n",
|
||||
idlc()->getOptions()->getProgramName().getStr(),
|
||||
@@ -87,7 +87,7 @@ bool AstModule::dump(RegistryKey& rKey)
|
||||
void const * pBlob = aBlob.getBlob(&aBlobSize);
|
||||
|
||||
if (localKey.setValue(emptyStr, RegValueType::BINARY,
|
||||
const_cast<RegValue>(pBlob), aBlobSize))
|
||||
const_cast<RegValue>(pBlob), aBlobSize) != RegError::NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n",
|
||||
idlc()->getOptions()->getProgramName().getStr(),
|
||||
@@ -112,7 +112,7 @@ bool AstModule::dump(RegistryKey& rKey)
|
||||
if ( getNodeType() != NT_root )
|
||||
{
|
||||
if (localKey.setValue(emptyStr, RegValueType::BINARY,
|
||||
const_cast<RegValue>(pBlob), aBlobSize))
|
||||
const_cast<RegValue>(pBlob), aBlobSize) != RegError::NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n",
|
||||
idlc()->getOptions()->getProgramName().getStr(),
|
||||
@@ -132,7 +132,7 @@ bool AstTypeDef::dump(RegistryKey& rKey)
|
||||
{
|
||||
OUString emptyStr;
|
||||
RegistryKey localKey;
|
||||
if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey))
|
||||
if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey) != RegError::NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n",
|
||||
idlc()->getOptions()->getProgramName().getStr(),
|
||||
@@ -152,7 +152,7 @@ bool AstTypeDef::dump(RegistryKey& rKey)
|
||||
sal_uInt32 aBlobSize;
|
||||
void const * pBlob = aBlob.getBlob(&aBlobSize);
|
||||
|
||||
if (localKey.setValue(emptyStr, RegValueType::BINARY, const_cast<RegValue>(pBlob), aBlobSize))
|
||||
if (localKey.setValue(emptyStr, RegValueType::BINARY, const_cast<RegValue>(pBlob), aBlobSize) != RegError::NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n",
|
||||
idlc()->getOptions()->getProgramName().getStr(),
|
||||
@@ -219,7 +219,7 @@ bool AstService::dump(RegistryKey& rKey)
|
||||
RegistryKey localKey;
|
||||
if (rKey.createKey(
|
||||
OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8),
|
||||
localKey)) {
|
||||
localKey) != RegError::NO_ERROR) {
|
||||
fprintf(
|
||||
stderr, "%s: warning, could not create key '%s' in '%s'\n",
|
||||
idlc()->getOptions()->getProgramName().getStr(),
|
||||
@@ -310,7 +310,7 @@ bool AstService::dump(RegistryKey& rKey)
|
||||
void const * blob = writer.getBlob(&size);
|
||||
if (localKey.setValue(
|
||||
emptyStr, RegValueType::BINARY, const_cast< void * >(blob),
|
||||
size))
|
||||
size) != RegError::NO_ERROR)
|
||||
{
|
||||
fprintf(
|
||||
stderr, "%s: warning, could not set value of key \"%s\" in %s\n",
|
||||
|
@@ -58,7 +58,7 @@ AstConstant* AstEnum::checkValue(AstExpression* pExpr)
|
||||
bool AstEnum::dump(RegistryKey& rKey)
|
||||
{
|
||||
RegistryKey localKey;
|
||||
if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey))
|
||||
if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey) != RegError::NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n",
|
||||
idlc()->getOptions()->getProgramName().getStr(),
|
||||
@@ -92,7 +92,7 @@ bool AstEnum::dump(RegistryKey& rKey)
|
||||
void const * pBlob = aBlob.getBlob(&aBlobSize);
|
||||
|
||||
if (localKey.setValue(emptyStr, RegValueType::BINARY,
|
||||
const_cast<RegValue>(pBlob), aBlobSize))
|
||||
const_cast<RegValue>(pBlob), aBlobSize) != RegError::NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n",
|
||||
idlc()->getOptions()->getProgramName().getStr(),
|
||||
|
@@ -105,7 +105,7 @@ bool AstInterface::dump(RegistryKey& rKey)
|
||||
return true;
|
||||
|
||||
RegistryKey localKey;
|
||||
if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey))
|
||||
if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey) != RegError::NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n",
|
||||
idlc()->getOptions()->getProgramName().getStr(),
|
||||
@@ -244,7 +244,7 @@ bool AstInterface::dump(RegistryKey& rKey)
|
||||
sal_uInt32 aBlobSize;
|
||||
void const * pBlob = aBlob.getBlob(&aBlobSize);
|
||||
|
||||
if (localKey.setValue(emptyStr, RegValueType::BINARY, const_cast<RegValue>(pBlob), aBlobSize))
|
||||
if (localKey.setValue(emptyStr, RegValueType::BINARY, const_cast<RegValue>(pBlob), aBlobSize) != RegError::NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n",
|
||||
idlc()->getOptions()->getProgramName().getStr(),
|
||||
|
@@ -78,7 +78,7 @@ bool AstStruct::isType() const {
|
||||
bool AstStruct::dump(RegistryKey& rKey)
|
||||
{
|
||||
RegistryKey localKey;
|
||||
if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey))
|
||||
if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey) != RegError::NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n",
|
||||
idlc()->getOptions()->getProgramName().getStr(),
|
||||
@@ -162,7 +162,7 @@ bool AstStruct::dump(RegistryKey& rKey)
|
||||
void const * pBlob = aBlob.getBlob(&aBlobSize);
|
||||
|
||||
if (localKey.setValue(emptyStr, RegValueType::BINARY,
|
||||
const_cast<RegValue>(pBlob), aBlobSize))
|
||||
const_cast<RegValue>(pBlob), aBlobSize) != RegError::NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n",
|
||||
idlc()->getOptions()->getProgramName().getStr(),
|
||||
|
@@ -154,7 +154,7 @@ produceFile(const OString& regFileName, sPair_t const*const pDepFile)
|
||||
OString urlRegTmpName = convertToFileUrl(regTmpName);
|
||||
|
||||
Registry regFile;
|
||||
if ( regFile.create(OStringToOUString(urlRegTmpName, RTL_TEXTENCODING_UTF8)) != REG_NO_ERROR )
|
||||
if ( regFile.create(OStringToOUString(urlRegTmpName, RTL_TEXTENCODING_UTF8)) != RegError::NO_ERROR )
|
||||
{
|
||||
fprintf(stderr, "%s: could not create registry file '%s'\n",
|
||||
pOptions->getProgramName().getStr(), regTmpName.getStr());
|
||||
@@ -165,7 +165,7 @@ produceFile(const OString& regFileName, sPair_t const*const pDepFile)
|
||||
}
|
||||
|
||||
RegistryKey rootKey;
|
||||
if ( regFile.openRootKey(rootKey) != REG_NO_ERROR )
|
||||
if ( regFile.openRootKey(rootKey) != RegError::NO_ERROR )
|
||||
{
|
||||
fprintf(stderr, "%s: could not open root of registry file '%s'\n",
|
||||
pOptions->getProgramName().getStr(), regFileName.getStr());
|
||||
@@ -179,7 +179,7 @@ produceFile(const OString& regFileName, sPair_t const*const pDepFile)
|
||||
if ( !idlc()->getRoot()->dump(rootKey) )
|
||||
{
|
||||
rootKey.releaseKey();
|
||||
if (regFile.close() != REG_NO_ERROR)
|
||||
if (regFile.close() != RegError::NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "%s: could not close registry file '%s'\n",
|
||||
pOptions->getProgramName().getStr(), regFileName.getStr());
|
||||
@@ -191,7 +191,7 @@ produceFile(const OString& regFileName, sPair_t const*const pDepFile)
|
||||
}
|
||||
|
||||
rootKey.releaseKey();
|
||||
if ( regFile.close() != REG_NO_ERROR )
|
||||
if ( regFile.close() != RegError::NO_ERROR )
|
||||
{
|
||||
fprintf(stderr, "%s: could not close registry file '%s'\n",
|
||||
pOptions->getProgramName().getStr(), regFileName.getStr());
|
||||
|
@@ -117,7 +117,7 @@ public:
|
||||
/** opens the root key of the registry.
|
||||
|
||||
@param rRootKey reference to a RegistryKey which is filled with the rootkey.
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError openRootKey(RegistryKey& rRootKey);
|
||||
|
||||
@@ -127,7 +127,7 @@ public:
|
||||
/** creates a new registry with the specified name and creates a root key.
|
||||
|
||||
@param registryName specifies the name of the new registry.
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError create(const rtl::OUString& registryName);
|
||||
|
||||
@@ -136,7 +136,7 @@ public:
|
||||
If the registry already points to a valid registry, the old registry will be closed.
|
||||
@param registryName specifies a registry name.
|
||||
@param accessMode specifies the access mode for the registry, RegAccessMode::READONLY or RegAccessMode::READWRITE.
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError open(const rtl::OUString& registryName,
|
||||
RegAccessMode accessMode);
|
||||
@@ -148,7 +148,7 @@ public:
|
||||
|
||||
@param registryName specifies a registry name, if the name is an empty string the registry
|
||||
itselfs will be destroyed.
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError destroy(const rtl::OUString& registryName);
|
||||
|
||||
@@ -161,7 +161,7 @@ public:
|
||||
is an empty string the registry information will be saved under the key specified
|
||||
by rKey.
|
||||
@param regFileName specifies the file containing the registry information.
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError loadKey(RegistryKey& rKey,
|
||||
const rtl::OUString& keyName,
|
||||
@@ -176,7 +176,7 @@ public:
|
||||
If keyName is an empty string the registry information under the key specified
|
||||
by rKey is saved in the specified file.
|
||||
@param regFileName specifies the file containing the registry information.
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError saveKey(RegistryKey& rKey,
|
||||
const rtl::OUString& keyName,
|
||||
@@ -194,7 +194,7 @@ public:
|
||||
@param regFileName specifies the file containing the registry information.
|
||||
@param bWarnings if TRUE the function returns an error if a key already exists.
|
||||
@param bReport if TRUE the function reports warnings on stdout if a key already exists.
|
||||
@return REG_NO_ERROR if succeeds else an error code. If it returns an error the registry will
|
||||
@return RegError::NO_ERROR if succeeds else an error code. If it returns an error the registry will
|
||||
restore the state before merging.
|
||||
*/
|
||||
inline RegError mergeKey(RegistryKey& rKey,
|
||||
@@ -208,7 +208,7 @@ public:
|
||||
All information which are available (keynames, value types, values, ...)
|
||||
will be printed to stdout for report issues only.
|
||||
@param rKey references a currently open key which content will be reported.
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError dumpRegistry(RegistryKey& rKey);
|
||||
|
||||
@@ -420,7 +420,7 @@ public:
|
||||
The specified keyname is relativ to this key.
|
||||
@param keyName specifies the name of the key which will be opened or created.
|
||||
@param rNewKey references a RegistryKey which will be filled with the new or open key.
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError createKey(const rtl::OUString& keyName,
|
||||
RegistryKey& rNewKey);
|
||||
@@ -430,7 +430,7 @@ public:
|
||||
The specified keyname is relativ to this key.
|
||||
@param keyName specifies the name of the key which will be opened.
|
||||
@param rOpenKey references a RegistryKey which will be filled with the open key.
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError openKey(const rtl::OUString& keyName,
|
||||
RegistryKey& rOpenKey);
|
||||
@@ -440,7 +440,7 @@ public:
|
||||
The specified keyname is relativ to this key.
|
||||
@param keyName specifies the name of the key which subkeys will be opened.
|
||||
@param rSubKeys reference a RegistryKeyArray which will be filled with the open subkeys.
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError openSubKeys(const rtl::OUString& keyName,
|
||||
RegistryKeyArray& rSubKeys);
|
||||
@@ -450,7 +450,7 @@ public:
|
||||
The specified keyname is relativ to this key.
|
||||
@param keyName specifies the name of the key which subkey names will be returned.
|
||||
@param rSubKeyNames reference a RegistryKeyNames array which will be filled with the subkey names.
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError getKeyNames(const rtl::OUString& keyName,
|
||||
RegistryKeyNames& rSubKeyNames);
|
||||
@@ -458,14 +458,14 @@ public:
|
||||
/** closes all keys specified in the array.
|
||||
|
||||
@param rSubKeys reference a RegistryKeyArray which contains the open keys.
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError closeSubKeys(RegistryKeyArray& rSubKeys);
|
||||
|
||||
/** deletes the specified key.
|
||||
|
||||
@param keyName specifies the name of the key which will be deleted.
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError deleteKey(const rtl::OUString& keyName);
|
||||
|
||||
@@ -483,7 +483,7 @@ public:
|
||||
@param valueType specifies the type of the value.
|
||||
@param pValue points to a memory block containing the data for the value.
|
||||
@param valueSize specifies the size of pData in bytes
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError setValue(const rtl::OUString& keyName,
|
||||
RegValueType valueType,
|
||||
@@ -497,7 +497,7 @@ public:
|
||||
specified by hKey.
|
||||
@param pValueList points to an array of longs containing the data for the value.
|
||||
@param len specifies the length of the list (the array referenced by pValueList).
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError setLongListValue(const rtl::OUString& keyName,
|
||||
sal_Int32* pValueList,
|
||||
@@ -510,7 +510,7 @@ public:
|
||||
specified by hKey.
|
||||
@param pValueList points to an array of sal_Char* containing the data for the value.
|
||||
@param len specifies the length of the list (the array referenced by pValueList).
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError setStringListValue(const rtl::OUString& keyName,
|
||||
sal_Char** pValueList,
|
||||
@@ -523,7 +523,7 @@ public:
|
||||
specified by hKey.
|
||||
@param pValueList points to an array of sal_Unicode* containing the data for the value.
|
||||
@param len specifies the length of the list (the array referenced by pValueList).
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError setUnicodeListValue(const rtl::OUString& keyName,
|
||||
sal_Unicode** pValueList,
|
||||
@@ -536,7 +536,7 @@ public:
|
||||
specified by hKey will be returned.
|
||||
@param pValueType returns the type of the value.
|
||||
@param pValueSize returns the size of the value in bytes or the length of a list value.
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError getValueInfo(const rtl::OUString& keyName,
|
||||
RegValueType* pValueType,
|
||||
@@ -548,7 +548,7 @@ public:
|
||||
If keyName is an empty string, the value is get from the key
|
||||
specified by hKey.
|
||||
@param pValue points to an allocated memory block receiving the data of the value.
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError getValue(const rtl::OUString& keyName,
|
||||
RegValue pValue);
|
||||
@@ -559,7 +559,7 @@ public:
|
||||
If keyName is an empty string, the value is get from the key
|
||||
specified by hKey.
|
||||
@param rValueList references a RegistryValueList which will be filled with the long values.
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError getLongListValue(const rtl::OUString& keyName,
|
||||
RegistryValueList<sal_Int32>& rValueList);
|
||||
@@ -570,7 +570,7 @@ public:
|
||||
If keyName is an empty string, the value is get from the key
|
||||
specified by hKey.
|
||||
@param rValueList references a RegistryValueList which will be filled with the ascii values.
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError getStringListValue(const rtl::OUString& keyName,
|
||||
RegistryValueList<sal_Char*>& rValueList);
|
||||
@@ -581,7 +581,7 @@ public:
|
||||
If keyName is an empty string, the value is get from the key
|
||||
specified by hKey.
|
||||
@param rValueList reference a RegistryValueList which will be filled with the unicode values.
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError getUnicodeListValue(const rtl::OUString& keyName,
|
||||
RegistryValueList<sal_Unicode*>& rValueList);
|
||||
@@ -590,7 +590,7 @@ public:
|
||||
|
||||
@deprecated Links are no longer supported.
|
||||
|
||||
@return REG_INVALID_LINK
|
||||
@return RegError::INVALID_LINK
|
||||
*/
|
||||
inline RegError createLink(const rtl::OUString& linkName,
|
||||
const rtl::OUString& linkTarget);
|
||||
@@ -599,7 +599,7 @@ public:
|
||||
|
||||
@deprecated Links are no longer supported.
|
||||
|
||||
@return REG_INVALID_LINK
|
||||
@return RegError::INVALID_LINK
|
||||
*/
|
||||
inline RegError deleteLink(const rtl::OUString& linkName);
|
||||
|
||||
@@ -607,7 +607,7 @@ public:
|
||||
|
||||
@deprecated Links are no longer supported.
|
||||
|
||||
@return REG_INVALID_LINK
|
||||
@return RegError::INVALID_LINK
|
||||
*/
|
||||
inline RegError getLinkTarget(const rtl::OUString& linkName,
|
||||
rtl::OUString& rLinkTarget) const;
|
||||
@@ -618,7 +618,7 @@ public:
|
||||
The resolved name will be prefixed with the name of this key.
|
||||
@param[in] firstLinkOnly ignored
|
||||
@param[out] rResolvedName the resolved name.
|
||||
@return REG_NO_ERROR if succeeds else an error code.
|
||||
@return RegError::NO_ERROR if succeeds else an error code.
|
||||
*/
|
||||
inline RegError getResolvedKeyName(const rtl::OUString& keyName,
|
||||
bool firstLinkOnly,
|
||||
@@ -706,7 +706,7 @@ inline RegError RegistryKeyArray::closeKeyHandles()
|
||||
m_phKeys = NULL;
|
||||
return ret;
|
||||
} else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
|
||||
@@ -750,14 +750,14 @@ inline RegError RegistryKeyNames::freeKeyNames()
|
||||
{
|
||||
if (m_registry.isValid() && m_pKeyNames)
|
||||
{
|
||||
RegError ret = REG_NO_ERROR;
|
||||
RegError ret = RegError::NO_ERROR;
|
||||
ret = m_registry.m_pApi->freeKeyNames(m_pKeyNames, m_length);
|
||||
m_registry = Registry();
|
||||
m_length = 0;
|
||||
m_pKeyNames = NULL;
|
||||
return ret;
|
||||
} else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
|
||||
@@ -836,10 +836,10 @@ inline RegError RegistryKey::createKey(const rtl::OUString& keyName,
|
||||
if (m_registry.isValid())
|
||||
{
|
||||
RegError ret = m_registry.m_pApi->createKey(m_hImpl, keyName.pData, &rNewKey.m_hImpl);
|
||||
if (!ret) rNewKey.setRegistry(m_registry);
|
||||
if (ret == RegError::NO_ERROR) rNewKey.setRegistry(m_registry);
|
||||
return ret;
|
||||
} else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
inline RegError RegistryKey::openKey(const rtl::OUString& keyName,
|
||||
@@ -850,10 +850,10 @@ inline RegError RegistryKey::openKey(const rtl::OUString& keyName,
|
||||
{
|
||||
RegError ret = m_registry.m_pApi->openKey(m_hImpl, keyName.pData,
|
||||
&rOpenKey.m_hImpl);
|
||||
if (!ret) rOpenKey.setRegistry(m_registry);
|
||||
if (ret == RegError::NO_ERROR) rOpenKey.setRegistry(m_registry);
|
||||
return ret;
|
||||
} else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
inline RegError RegistryKey::openSubKeys(const rtl::OUString& keyName,
|
||||
@@ -861,12 +861,12 @@ inline RegError RegistryKey::openSubKeys(const rtl::OUString& keyName,
|
||||
{
|
||||
if (m_registry.isValid())
|
||||
{
|
||||
RegError ret = REG_NO_ERROR;
|
||||
RegError ret = RegError::NO_ERROR;
|
||||
RegKeyHandle* pSubKeys;
|
||||
sal_uInt32 nSubKeys;
|
||||
ret = m_registry.m_pApi->openSubKeys(m_hImpl, keyName.pData,
|
||||
ret = m_registry.m_pApi->openSubKeys(m_hImpl, keyName.pData,
|
||||
&pSubKeys, &nSubKeys);
|
||||
if ( ret )
|
||||
if ( ret != RegError::NO_ERROR)
|
||||
{
|
||||
return ret;
|
||||
} else
|
||||
@@ -875,7 +875,7 @@ inline RegError RegistryKey::openSubKeys(const rtl::OUString& keyName,
|
||||
return ret;
|
||||
}
|
||||
} else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
inline RegError RegistryKey::getKeyNames(const rtl::OUString& keyName,
|
||||
@@ -883,12 +883,12 @@ inline RegError RegistryKey::getKeyNames(const rtl::OUString& keyName,
|
||||
{
|
||||
if (m_registry.isValid())
|
||||
{
|
||||
RegError ret = REG_NO_ERROR;
|
||||
RegError ret = RegError::NO_ERROR;
|
||||
rtl_uString** pSubKeyNames;
|
||||
sal_uInt32 nSubKeys;
|
||||
ret = m_registry.m_pApi->getKeyNames(m_hImpl, keyName.pData,
|
||||
ret = m_registry.m_pApi->getKeyNames(m_hImpl, keyName.pData,
|
||||
&pSubKeyNames, &nSubKeys);
|
||||
if ( ret )
|
||||
if ( ret != RegError::NO_ERROR)
|
||||
{
|
||||
return ret;
|
||||
} else
|
||||
@@ -897,7 +897,7 @@ inline RegError RegistryKey::getKeyNames(const rtl::OUString& keyName,
|
||||
return ret;
|
||||
}
|
||||
} else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
inline RegError RegistryKey::closeSubKeys(RegistryKeyArray& rSubKeys)
|
||||
@@ -905,7 +905,7 @@ inline RegError RegistryKey::closeSubKeys(RegistryKeyArray& rSubKeys)
|
||||
if (m_registry.isValid())
|
||||
return rSubKeys.closeKeyHandles();
|
||||
else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
inline RegError RegistryKey::deleteKey(const rtl::OUString& keyName)
|
||||
@@ -913,7 +913,7 @@ inline RegError RegistryKey::deleteKey(const rtl::OUString& keyName)
|
||||
if (m_registry.isValid())
|
||||
return m_registry.m_pApi->deleteKey(m_hImpl, keyName.pData);
|
||||
else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
inline RegError RegistryKey::closeKey()
|
||||
@@ -921,14 +921,14 @@ inline RegError RegistryKey::closeKey()
|
||||
if (m_registry.isValid())
|
||||
{
|
||||
RegError ret = m_registry.m_pApi->closeKey(m_hImpl);
|
||||
if (!ret)
|
||||
if (ret == RegError::NO_ERROR)
|
||||
{
|
||||
m_hImpl = NULL;
|
||||
m_registry = Registry();
|
||||
}
|
||||
return ret;
|
||||
} else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
inline void RegistryKey::releaseKey()
|
||||
@@ -948,7 +948,7 @@ inline RegError RegistryKey::setValue(const rtl::OUString& keyName,
|
||||
return m_registry.m_pApi->setValue(m_hImpl, keyName.pData, valueType,
|
||||
pValue, valueSize);
|
||||
else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
inline RegError RegistryKey::setLongListValue(const rtl::OUString& keyName,
|
||||
@@ -959,7 +959,7 @@ inline RegError RegistryKey::setLongListValue(const rtl::OUString& keyName,
|
||||
return m_registry.m_pApi->setLongListValue(m_hImpl, keyName.pData,
|
||||
pValueList, len);
|
||||
else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
inline RegError RegistryKey::setStringListValue(const rtl::OUString& keyName,
|
||||
@@ -970,7 +970,7 @@ inline RegError RegistryKey::setStringListValue(const rtl::OUString& keyName,
|
||||
return m_registry.m_pApi->setStringListValue(m_hImpl, keyName.pData,
|
||||
pValueList, len);
|
||||
else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
inline RegError RegistryKey::setUnicodeListValue(const rtl::OUString& keyName,
|
||||
@@ -981,7 +981,7 @@ inline RegError RegistryKey::setUnicodeListValue(const rtl::OUString& keyName,
|
||||
return m_registry.m_pApi->setUnicodeListValue(m_hImpl, keyName.pData,
|
||||
pValueList, len);
|
||||
else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
inline RegError RegistryKey::getValueInfo(const rtl::OUString& keyName,
|
||||
@@ -991,7 +991,7 @@ inline RegError RegistryKey::getValueInfo(const rtl::OUString& keyName,
|
||||
if (m_registry.isValid())
|
||||
return m_registry.m_pApi->getValueInfo(m_hImpl, keyName.pData, pValueType, pValueSize);
|
||||
else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
inline RegError RegistryKey::getValue(const rtl::OUString& keyName,
|
||||
@@ -1000,7 +1000,7 @@ inline RegError RegistryKey::getValue(const rtl::OUString& keyName,
|
||||
if (m_registry.isValid())
|
||||
return m_registry.m_pApi->getValue(m_hImpl, keyName.pData, pValue);
|
||||
else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
inline RegError RegistryKey::getLongListValue(const rtl::OUString& keyName,
|
||||
@@ -1008,12 +1008,12 @@ inline RegError RegistryKey::getLongListValue(const rtl::OUString& keyName,
|
||||
{
|
||||
if (m_registry.isValid())
|
||||
{
|
||||
RegError ret = REG_NO_ERROR;
|
||||
RegError ret = RegError::NO_ERROR;
|
||||
sal_Int32* pValueList;
|
||||
sal_uInt32 length;
|
||||
ret = m_registry.m_pApi->getLongListValue(m_hImpl, keyName.pData,
|
||||
ret = m_registry.m_pApi->getLongListValue(m_hImpl, keyName.pData,
|
||||
&pValueList, &length);
|
||||
if ( ret )
|
||||
if ( ret != RegError::NO_ERROR)
|
||||
{
|
||||
return ret;
|
||||
} else
|
||||
@@ -1023,7 +1023,7 @@ inline RegError RegistryKey::getLongListValue(const rtl::OUString& keyName,
|
||||
return ret;
|
||||
}
|
||||
} else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
inline RegError RegistryKey::getStringListValue(const rtl::OUString& keyName,
|
||||
@@ -1031,12 +1031,12 @@ inline RegError RegistryKey::getStringListValue(const rtl::OUString& keyName,
|
||||
{
|
||||
if (m_registry.isValid())
|
||||
{
|
||||
RegError ret = REG_NO_ERROR;
|
||||
RegError ret = RegError::NO_ERROR;
|
||||
sal_Char** pValueList;
|
||||
sal_uInt32 length;
|
||||
ret = m_registry.m_pApi->getStringListValue(m_hImpl, keyName.pData,
|
||||
ret = m_registry.m_pApi->getStringListValue(m_hImpl, keyName.pData,
|
||||
&pValueList, &length);
|
||||
if ( ret )
|
||||
if ( ret != RegError::NO_ERROR )
|
||||
{
|
||||
return ret;
|
||||
} else
|
||||
@@ -1046,7 +1046,7 @@ inline RegError RegistryKey::getStringListValue(const rtl::OUString& keyName,
|
||||
return ret;
|
||||
}
|
||||
} else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
inline RegError RegistryKey::getUnicodeListValue(const rtl::OUString& keyName,
|
||||
@@ -1054,12 +1054,12 @@ inline RegError RegistryKey::getUnicodeListValue(const rtl::OUString& keyName,
|
||||
{
|
||||
if (m_registry.isValid())
|
||||
{
|
||||
RegError ret = REG_NO_ERROR;
|
||||
RegError ret = RegError::NO_ERROR;
|
||||
sal_Unicode** pValueList;
|
||||
sal_uInt32 length;
|
||||
ret = m_registry.m_pApi->getUnicodeListValue(m_hImpl, keyName.pData,
|
||||
ret = m_registry.m_pApi->getUnicodeListValue(m_hImpl, keyName.pData,
|
||||
&pValueList, &length);
|
||||
if ( ret )
|
||||
if ( ret != RegError::NO_ERROR )
|
||||
{
|
||||
return ret;
|
||||
} else
|
||||
@@ -1069,33 +1069,33 @@ inline RegError RegistryKey::getUnicodeListValue(const rtl::OUString& keyName,
|
||||
return ret;
|
||||
}
|
||||
} else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
inline RegError RegistryKey::createLink(const rtl::OUString& ,
|
||||
const rtl::OUString& )
|
||||
{
|
||||
if (m_registry.isValid())
|
||||
return REG_INVALID_LINK; // links are no longer supported
|
||||
return RegError::INVALID_LINK; // links are no longer supported
|
||||
else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
inline RegError RegistryKey::deleteLink(const rtl::OUString& )
|
||||
{
|
||||
if (m_registry.isValid())
|
||||
return REG_INVALID_LINK; // links are no longer supported
|
||||
return RegError::INVALID_LINK; // links are no longer supported
|
||||
else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
inline RegError RegistryKey::getLinkTarget(const rtl::OUString& ,
|
||||
rtl::OUString& ) const
|
||||
{
|
||||
if (m_registry.isValid())
|
||||
return REG_INVALID_LINK; // links are no longer supported
|
||||
return RegError::INVALID_LINK; // links are no longer supported
|
||||
else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
|
||||
@@ -1109,7 +1109,7 @@ inline RegError RegistryKey::getResolvedKeyName(const rtl::OUString& keyName,
|
||||
firstLinkOnly,
|
||||
&rResolvedName.pData);
|
||||
else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
|
||||
inline rtl::OUString RegistryKey::getRegistryName()
|
||||
@@ -1193,7 +1193,7 @@ inline RegError Registry::open(const rtl::OUString& registryName,
|
||||
inline RegError Registry::close()
|
||||
{
|
||||
RegError ret = m_pApi->closeRegistry(m_hImpl);
|
||||
if (!ret)
|
||||
if (ret == RegError::NO_ERROR)
|
||||
m_hImpl = NULL;
|
||||
return ret;
|
||||
}
|
||||
@@ -1201,7 +1201,7 @@ inline RegError Registry::close()
|
||||
inline RegError Registry::destroy(const rtl::OUString& registryName)
|
||||
{
|
||||
RegError ret = m_pApi->destroyRegistry(m_hImpl, registryName.pData);
|
||||
if ( !ret && registryName.isEmpty() )
|
||||
if ( ret == RegError::NO_ERROR && registryName.isEmpty() )
|
||||
m_hImpl = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
@@ -77,77 +77,77 @@ enum class SAL_DLLPUBLIC_RTTI RegValueType
|
||||
};
|
||||
|
||||
/// specifies the possible error codes which can occur using the registry API.
|
||||
enum SAL_DLLPUBLIC_RTTI RegError
|
||||
enum class SAL_DLLPUBLIC_RTTI RegError
|
||||
{
|
||||
/// no error.
|
||||
REG_NO_ERROR,
|
||||
NO_ERROR,
|
||||
/// internal registry error.
|
||||
REG_INTERNAL_ERROR,
|
||||
INTERNAL_ERROR,
|
||||
|
||||
/// registry is not open.
|
||||
REG_REGISTRY_NOT_OPEN,
|
||||
REGISTRY_NOT_OPEN,
|
||||
/// registry does not exists.
|
||||
REG_REGISTRY_NOT_EXISTS,
|
||||
REGISTRY_NOT_EXISTS,
|
||||
/// registry is open with readonly access rights.
|
||||
REG_REGISTRY_READONLY,
|
||||
REGISTRY_READONLY,
|
||||
/// destroy a registry failed. There are may be any open keys.
|
||||
REG_DESTROY_REGISTRY_FAILED,
|
||||
DESTROY_REGISTRY_FAILED,
|
||||
/** registry cannot be opened with readwrite access because the registry is already
|
||||
open with readwrite access anywhere.
|
||||
*/
|
||||
REG_CANNOT_OPEN_FOR_READWRITE,
|
||||
CANNOT_OPEN_FOR_READWRITE,
|
||||
/** registry is in an invalid state or the registry does not point to
|
||||
a valid registry data file.
|
||||
*/
|
||||
REG_INVALID_REGISTRY,
|
||||
INVALID_REGISTRY,
|
||||
|
||||
/// the key or key handle points to an invalid key or closed key.
|
||||
REG_KEY_NOT_OPEN,
|
||||
KEY_NOT_OPEN,
|
||||
/// the specified keyname points to a nonexisting key.
|
||||
REG_KEY_NOT_EXISTS,
|
||||
KEY_NOT_EXISTS,
|
||||
/// the key with the specified keyname cannot be created.
|
||||
REG_CREATE_KEY_FAILED,
|
||||
CREATE_KEY_FAILED,
|
||||
/// the specified key cannot be deleted. Maybe an open key handle exists to this key.
|
||||
REG_DELETE_KEY_FAILED,
|
||||
DELETE_KEY_FAILED,
|
||||
/** the keyname is invalid. This error will return if the keyname
|
||||
is NULL but should not be NULL in the context of a called function.
|
||||
*/
|
||||
REG_INVALID_KEYNAME,
|
||||
INVALID_KEYNAME,
|
||||
/// the key is not in a valid state.
|
||||
REG_INVALID_KEY,
|
||||
INVALID_KEY,
|
||||
|
||||
/// the key has no value
|
||||
REG_VALUE_NOT_EXISTS,
|
||||
VALUE_NOT_EXISTS,
|
||||
/// setting the specified value of a key failed.
|
||||
REG_SET_VALUE_FAILED,
|
||||
SET_VALUE_FAILED,
|
||||
/// deleting of the key value failed.
|
||||
REG_DELETE_VALUE_FAILED,
|
||||
DELETE_VALUE_FAILED,
|
||||
/// the key has a invalid value or the value type is unknown.
|
||||
REG_INVALID_VALUE,
|
||||
INVALID_VALUE,
|
||||
|
||||
/// merging a key, the value and all subkeys failed.
|
||||
REG_MERGE_ERROR,
|
||||
MERGE_ERROR,
|
||||
/** conflicts exists during the merge process of a key. This could happen if
|
||||
the value of a key already exists and the merge process will replace it.
|
||||
*/
|
||||
REG_MERGE_CONFLICT,
|
||||
MERGE_CONFLICT,
|
||||
|
||||
/** a recursion was detected resolving different link targets (no longer
|
||||
used).
|
||||
*/
|
||||
REG_DETECT_RECURSION,
|
||||
DETECT_RECURSION,
|
||||
/** the link is invalid and can not be resolved (now used by all
|
||||
link-related operations, as links are no longer supported).
|
||||
*/
|
||||
REG_INVALID_LINK,
|
||||
INVALID_LINK,
|
||||
/// the specified linkname is not valid (no longer used).
|
||||
REG_INVALID_LINKNAME,
|
||||
INVALID_LINKNAME,
|
||||
/// the linknane is not valid (no longer used).
|
||||
REG_INVALID_LINKTARGET,
|
||||
INVALID_LINKTARGET,
|
||||
/// the link target points to a nonexisting key (no longer used).
|
||||
REG_LINKTARGET_NOT_EXIST,
|
||||
LINKTARGET_NOT_EXIST,
|
||||
/// the reserved buffer for the resolved keyname is to small.
|
||||
REG_BUFFERSIZE_TOSMALL
|
||||
BUFFERSIZE_TOSMALL
|
||||
};
|
||||
|
||||
/// specify the calling convention for the registry API
|
||||
|
@@ -82,7 +82,7 @@ RegError ORegKey::openKey(const OUString& keyName, RegKeyHandle* phOpenKey)
|
||||
|
||||
RegError ORegKey::openSubKeys(const OUString& keyName, RegKeyHandle** phOpenSubKeys, sal_uInt32* pnSubKeys)
|
||||
{
|
||||
RegError _ret = REG_NO_ERROR;
|
||||
RegError _ret = RegError::NO_ERROR;
|
||||
|
||||
*phOpenSubKeys = 0;
|
||||
*pnSubKeys = 0;
|
||||
@@ -91,7 +91,7 @@ RegError ORegKey::openSubKeys(const OUString& keyName, RegKeyHandle** phOpenSubK
|
||||
if ( !keyName.isEmpty() )
|
||||
{
|
||||
_ret = openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pKey));
|
||||
if (_ret != REG_NO_ERROR)
|
||||
if (_ret != RegError::NO_ERROR)
|
||||
return _ret;
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ RegError ORegKey::openSubKeys(const OUString& keyName, RegKeyHandle** phOpenSubK
|
||||
|
||||
ORegKey* pOpenSubKey = 0;
|
||||
_ret = pKey->openKey(sSubKeyName, reinterpret_cast<RegKeyHandle*>(&pOpenSubKey));
|
||||
if (_ret != REG_NO_ERROR)
|
||||
if (_ret != RegError::NO_ERROR)
|
||||
{
|
||||
*phOpenSubKeys = NULL;
|
||||
*pnSubKeys = 0;
|
||||
@@ -135,7 +135,7 @@ RegError ORegKey::openSubKeys(const OUString& keyName, RegKeyHandle** phOpenSubK
|
||||
{
|
||||
(void) releaseKey(pKey);
|
||||
}
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ RegError ORegKey::getKeyNames(const OUString& keyName,
|
||||
rtl_uString*** pSubKeyNames,
|
||||
sal_uInt32* pnSubKeys)
|
||||
{
|
||||
RegError _ret = REG_NO_ERROR;
|
||||
RegError _ret = RegError::NO_ERROR;
|
||||
|
||||
*pSubKeyNames = 0;
|
||||
*pnSubKeys = 0;
|
||||
@@ -155,7 +155,7 @@ RegError ORegKey::getKeyNames(const OUString& keyName,
|
||||
if (!keyName.isEmpty())
|
||||
{
|
||||
_ret = openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pKey));
|
||||
if (_ret != REG_NO_ERROR)
|
||||
if (_ret != RegError::NO_ERROR)
|
||||
return _ret;
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ RegError ORegKey::getKeyNames(const OUString& keyName,
|
||||
{
|
||||
releaseKey(pKey);
|
||||
}
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -240,7 +240,7 @@ RegError ORegKey::getValueInfo(const OUString& valueName, RegValueType* pValueTy
|
||||
{
|
||||
*pValueType = RegValueType::NOT_DEFINED;
|
||||
*pValueSize = 0;
|
||||
return REG_VALUE_NOT_EXISTS;
|
||||
return RegError::VALUE_NOT_EXISTS;
|
||||
}
|
||||
|
||||
pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE));
|
||||
@@ -249,12 +249,12 @@ RegError ORegKey::getValueInfo(const OUString& valueName, RegValueType* pValueTy
|
||||
if ( rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, readBytes) )
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
if (readBytes != VALUE_HEADERSIZE)
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
sal_uInt32 size;
|
||||
@@ -280,7 +280,7 @@ RegError ORegKey::getValueInfo(const OUString& valueName, RegValueType* pValueTy
|
||||
// }
|
||||
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -294,12 +294,12 @@ RegError ORegKey::setValue(const OUString& valueName, RegValueType vType, RegVal
|
||||
|
||||
if (m_pRegistry->isReadOnly())
|
||||
{
|
||||
return REG_REGISTRY_READONLY;
|
||||
return RegError::REGISTRY_READONLY;
|
||||
}
|
||||
|
||||
if (vType > RegValueType::BINARY)
|
||||
{
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
OUString sImplValueName( VALUE_PREFIX );
|
||||
@@ -309,7 +309,7 @@ RegError ORegKey::setValue(const OUString& valueName, RegValueType vType, RegVal
|
||||
|
||||
if ( rValue.create(getStoreFile(), m_name + m_pRegistry->ROOT , sImplValueName, VALUE_MODE_CREATE) )
|
||||
{
|
||||
return REG_SET_VALUE_FAILED;
|
||||
return RegError::SET_VALUE_FAILED;
|
||||
}
|
||||
|
||||
sal_uInt32 size = vSize;
|
||||
@@ -346,17 +346,17 @@ RegError ORegKey::setValue(const OUString& valueName, RegValueType vType, RegVal
|
||||
if ( rValue.writeAt(0, pBuffer, VALUE_HEADERSIZE+size, writenBytes) )
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_SET_VALUE_FAILED;
|
||||
return RegError::SET_VALUE_FAILED;
|
||||
}
|
||||
if (writenBytes != (VALUE_HEADERSIZE+size))
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_SET_VALUE_FAILED;
|
||||
return RegError::SET_VALUE_FAILED;
|
||||
}
|
||||
setModified();
|
||||
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -369,7 +369,7 @@ RegError ORegKey::setLongListValue(const OUString& valueName, sal_Int32* pValueL
|
||||
|
||||
if (m_pRegistry->isReadOnly())
|
||||
{
|
||||
return REG_REGISTRY_READONLY;
|
||||
return RegError::REGISTRY_READONLY;
|
||||
}
|
||||
|
||||
OUString sImplValueName( VALUE_PREFIX );
|
||||
@@ -379,7 +379,7 @@ RegError ORegKey::setLongListValue(const OUString& valueName, sal_Int32* pValueL
|
||||
|
||||
if (rValue.create(getStoreFile(), m_name + m_pRegistry->ROOT, sImplValueName, VALUE_MODE_CREATE) )
|
||||
{
|
||||
return REG_SET_VALUE_FAILED;
|
||||
return RegError::SET_VALUE_FAILED;
|
||||
}
|
||||
|
||||
sal_uInt32 size = 4; // 4 bytes (sal_uInt32) for the length
|
||||
@@ -405,17 +405,17 @@ RegError ORegKey::setLongListValue(const OUString& valueName, sal_Int32* pValueL
|
||||
if ( rValue.writeAt(0, pBuffer, VALUE_HEADERSIZE+size, writenBytes) )
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_SET_VALUE_FAILED;
|
||||
return RegError::SET_VALUE_FAILED;
|
||||
}
|
||||
if (writenBytes != (VALUE_HEADEROFFSET+size))
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_SET_VALUE_FAILED;
|
||||
return RegError::SET_VALUE_FAILED;
|
||||
}
|
||||
setModified();
|
||||
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -428,7 +428,7 @@ RegError ORegKey::setStringListValue(const OUString& valueName, sal_Char** pValu
|
||||
|
||||
if (m_pRegistry->isReadOnly())
|
||||
{
|
||||
return REG_REGISTRY_READONLY;
|
||||
return RegError::REGISTRY_READONLY;
|
||||
}
|
||||
|
||||
OUString sImplValueName( VALUE_PREFIX );
|
||||
@@ -438,7 +438,7 @@ RegError ORegKey::setStringListValue(const OUString& valueName, sal_Char** pValu
|
||||
|
||||
if (rValue.create(getStoreFile(), m_name + m_pRegistry->ROOT, sImplValueName, VALUE_MODE_CREATE) )
|
||||
{
|
||||
return REG_SET_VALUE_FAILED;
|
||||
return RegError::SET_VALUE_FAILED;
|
||||
}
|
||||
|
||||
sal_uInt32 size = 4; // 4 bytes (sal_uInt32) for the length
|
||||
@@ -473,17 +473,17 @@ RegError ORegKey::setStringListValue(const OUString& valueName, sal_Char** pValu
|
||||
if ( rValue.writeAt(0, pBuffer, VALUE_HEADERSIZE+size, writenBytes) )
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_SET_VALUE_FAILED;
|
||||
return RegError::SET_VALUE_FAILED;
|
||||
}
|
||||
if (writenBytes != (VALUE_HEADERSIZE+size))
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_SET_VALUE_FAILED;
|
||||
return RegError::SET_VALUE_FAILED;
|
||||
}
|
||||
setModified();
|
||||
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -496,7 +496,7 @@ RegError ORegKey::setUnicodeListValue(const OUString& valueName, sal_Unicode** p
|
||||
|
||||
if (m_pRegistry->isReadOnly())
|
||||
{
|
||||
return REG_REGISTRY_READONLY;
|
||||
return RegError::REGISTRY_READONLY;
|
||||
}
|
||||
|
||||
OUString sImplValueName( VALUE_PREFIX );
|
||||
@@ -506,7 +506,7 @@ RegError ORegKey::setUnicodeListValue(const OUString& valueName, sal_Unicode** p
|
||||
|
||||
if (rValue.create(getStoreFile(), m_name + m_pRegistry->ROOT, sImplValueName, VALUE_MODE_CREATE) )
|
||||
{
|
||||
return REG_SET_VALUE_FAILED;
|
||||
return RegError::SET_VALUE_FAILED;
|
||||
}
|
||||
|
||||
sal_uInt32 size = 4; // 4 bytes (sal_uInt32) for the length
|
||||
@@ -541,17 +541,17 @@ RegError ORegKey::setUnicodeListValue(const OUString& valueName, sal_Unicode** p
|
||||
if ( rValue.writeAt(0, pBuffer, VALUE_HEADERSIZE+size, writenBytes) )
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_SET_VALUE_FAILED;
|
||||
return RegError::SET_VALUE_FAILED;
|
||||
}
|
||||
if (writenBytes != (VALUE_HEADERSIZE+size))
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_SET_VALUE_FAILED;
|
||||
return RegError::SET_VALUE_FAILED;
|
||||
}
|
||||
setModified();
|
||||
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -577,7 +577,7 @@ RegError ORegKey::getValue(const OUString& valueName, RegValue value) const
|
||||
|
||||
if (rValue.create(getStoreFile(), m_name + m_pRegistry->ROOT, sImplValueName, accessMode) )
|
||||
{
|
||||
return REG_VALUE_NOT_EXISTS;
|
||||
return RegError::VALUE_NOT_EXISTS;
|
||||
}
|
||||
|
||||
pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE));
|
||||
@@ -586,12 +586,12 @@ RegError ORegKey::getValue(const OUString& valueName, RegValue value) const
|
||||
if ( rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, readBytes) )
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
if (readBytes != VALUE_HEADERSIZE)
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
sal_uInt8 type = *((sal_uInt8*)pBuffer);
|
||||
@@ -602,7 +602,7 @@ RegError ORegKey::getValue(const OUString& valueName, RegValue value) const
|
||||
|
||||
if (valueType > RegValueType::BINARY)
|
||||
{
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(valueSize));
|
||||
@@ -610,12 +610,12 @@ RegError ORegKey::getValue(const OUString& valueName, RegValue value) const
|
||||
if ( rValue.readAt(VALUE_HEADEROFFSET, pBuffer, valueSize, readBytes) )
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
if (readBytes != valueSize)
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
switch (valueType)
|
||||
@@ -645,7 +645,7 @@ RegError ORegKey::getValue(const OUString& valueName, RegValue value) const
|
||||
|
||||
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -673,7 +673,7 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue
|
||||
{
|
||||
pValueList = NULL;
|
||||
*pLen = 0;
|
||||
return REG_VALUE_NOT_EXISTS;
|
||||
return RegError::VALUE_NOT_EXISTS;
|
||||
}
|
||||
|
||||
pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE));
|
||||
@@ -684,14 +684,14 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue
|
||||
pValueList = NULL;
|
||||
*pLen = 0;
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
if (readBytes != VALUE_HEADERSIZE)
|
||||
{
|
||||
pValueList = NULL;
|
||||
*pLen = 0;
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
sal_uInt8 type = *((sal_uInt8*)pBuffer);
|
||||
@@ -702,7 +702,7 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue
|
||||
pValueList = NULL;
|
||||
*pLen = 0;
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
readUINT32(pBuffer+VALUE_TYPEOFFSET, valueSize);
|
||||
@@ -716,7 +716,7 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue
|
||||
pValueList = NULL;
|
||||
*pLen = 0;
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(valueSize));
|
||||
|
||||
@@ -725,14 +725,14 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue
|
||||
pValueList = NULL;
|
||||
*pLen = 0;
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
if (readBytes != valueSize)
|
||||
{
|
||||
pValueList = NULL;
|
||||
*pLen = 0;
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
sal_uInt32 len = 0;
|
||||
@@ -744,7 +744,7 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue
|
||||
pValueList = NULL;
|
||||
*pLen = 0;
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
*pLen = len;
|
||||
sal_Int32* pVList = static_cast<sal_Int32*>(rtl_allocateZeroMemory(len * sizeof(sal_Int32)));
|
||||
@@ -759,7 +759,7 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue
|
||||
|
||||
*pValueList = pVList;
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -787,7 +787,7 @@ RegError ORegKey::getStringListValue(const OUString& valueName, sal_Char*** pVal
|
||||
{
|
||||
pValueList = NULL;
|
||||
*pLen = 0;
|
||||
return REG_VALUE_NOT_EXISTS;
|
||||
return RegError::VALUE_NOT_EXISTS;
|
||||
}
|
||||
|
||||
pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE));
|
||||
@@ -798,14 +798,14 @@ RegError ORegKey::getStringListValue(const OUString& valueName, sal_Char*** pVal
|
||||
pValueList = NULL;
|
||||
*pLen = 0;
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
if (readBytes != VALUE_HEADERSIZE)
|
||||
{
|
||||
pValueList = NULL;
|
||||
*pLen = 0;
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
sal_uInt8 type = *((sal_uInt8*)pBuffer);
|
||||
@@ -816,7 +816,7 @@ RegError ORegKey::getStringListValue(const OUString& valueName, sal_Char*** pVal
|
||||
pValueList = NULL;
|
||||
*pLen = 0;
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
readUINT32(pBuffer+VALUE_TYPEOFFSET, valueSize);
|
||||
@@ -830,14 +830,14 @@ RegError ORegKey::getStringListValue(const OUString& valueName, sal_Char*** pVal
|
||||
pValueList = NULL;
|
||||
*pLen = 0;
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
if (readBytes != valueSize)
|
||||
{
|
||||
pValueList = NULL;
|
||||
*pLen = 0;
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
sal_uInt32 len = 0;
|
||||
@@ -865,7 +865,7 @@ RegError ORegKey::getStringListValue(const OUString& valueName, sal_Char*** pVal
|
||||
|
||||
*pValueList = pVList;
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -893,7 +893,7 @@ RegError ORegKey::getUnicodeListValue(const OUString& valueName, sal_Unicode***
|
||||
{
|
||||
pValueList = NULL;
|
||||
*pLen = 0;
|
||||
return REG_VALUE_NOT_EXISTS;
|
||||
return RegError::VALUE_NOT_EXISTS;
|
||||
}
|
||||
|
||||
pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE));
|
||||
@@ -904,14 +904,14 @@ RegError ORegKey::getUnicodeListValue(const OUString& valueName, sal_Unicode***
|
||||
pValueList = NULL;
|
||||
*pLen = 0;
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
if (readBytes != VALUE_HEADERSIZE)
|
||||
{
|
||||
pValueList = NULL;
|
||||
*pLen = 0;
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
sal_uInt8 type = *((sal_uInt8*)pBuffer);
|
||||
@@ -922,7 +922,7 @@ RegError ORegKey::getUnicodeListValue(const OUString& valueName, sal_Unicode***
|
||||
pValueList = NULL;
|
||||
*pLen = 0;
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
readUINT32(pBuffer+VALUE_TYPEOFFSET, valueSize);
|
||||
@@ -936,14 +936,14 @@ RegError ORegKey::getUnicodeListValue(const OUString& valueName, sal_Unicode***
|
||||
pValueList = NULL;
|
||||
*pLen = 0;
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
if (readBytes != valueSize)
|
||||
{
|
||||
pValueList = NULL;
|
||||
*pLen = 0;
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
sal_uInt32 len = 0;
|
||||
@@ -971,7 +971,7 @@ RegError ORegKey::getUnicodeListValue(const OUString& valueName, sal_Unicode***
|
||||
|
||||
*pValueList = pVList;
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -979,10 +979,10 @@ RegError ORegKey::getResolvedKeyName(const OUString& keyName,
|
||||
OUString& resolvedName)
|
||||
{
|
||||
if (keyName.isEmpty())
|
||||
return REG_INVALID_KEYNAME;
|
||||
return RegError::INVALID_KEYNAME;
|
||||
|
||||
resolvedName = getFullPath(keyName);
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -454,7 +454,7 @@ ORegistry::~ORegistry()
|
||||
|
||||
RegError ORegistry::initRegistry(const OUString& regName, RegAccessMode accessMode, bool bCreate)
|
||||
{
|
||||
RegError eRet = REG_INVALID_REGISTRY;
|
||||
RegError eRet = RegError::INVALID_REGISTRY;
|
||||
OStoreFile rRegFile;
|
||||
storeAccessMode sAccessMode = REG_MODE_OPEN;
|
||||
storeError errCode;
|
||||
@@ -484,13 +484,13 @@ RegError ORegistry::initRegistry(const OUString& regName, RegAccessMode accessMo
|
||||
switch (errCode)
|
||||
{
|
||||
case store_E_NotExists:
|
||||
eRet = REG_REGISTRY_NOT_EXISTS;
|
||||
eRet = RegError::REGISTRY_NOT_EXISTS;
|
||||
break;
|
||||
case store_E_LockingViolation:
|
||||
eRet = REG_CANNOT_OPEN_FOR_READWRITE;
|
||||
eRet = RegError::CANNOT_OPEN_FOR_READWRITE;
|
||||
break;
|
||||
default:
|
||||
eRet = REG_INVALID_REGISTRY;
|
||||
eRet = RegError::INVALID_REGISTRY;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -506,10 +506,10 @@ RegError ORegistry::initRegistry(const OUString& regName, RegAccessMode accessMo
|
||||
m_isOpen = true;
|
||||
|
||||
m_openKeyTable[ROOT] = new ORegKey(ROOT, this);
|
||||
eRet = REG_NO_ERROR;
|
||||
eRet = RegError::NO_ERROR;
|
||||
}
|
||||
else
|
||||
eRet = REG_INVALID_REGISTRY;
|
||||
eRet = RegError::INVALID_REGISTRY;
|
||||
}
|
||||
|
||||
return eRet;
|
||||
@@ -528,10 +528,10 @@ RegError ORegistry::closeRegistry()
|
||||
(void) releaseKey(m_openKeyTable[ROOT]);
|
||||
m_file.close();
|
||||
m_isOpen = false;
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
} else
|
||||
{
|
||||
return REG_REGISTRY_NOT_EXISTS;
|
||||
return RegError::REGISTRY_NOT_EXISTS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -547,7 +547,7 @@ RegError ORegistry::destroyRegistry(const OUString& regName)
|
||||
{
|
||||
std::unique_ptr<ORegistry> pReg(new ORegistry());
|
||||
|
||||
if (!pReg->initRegistry(regName, RegAccessMode::READWRITE))
|
||||
if (pReg->initRegistry(regName, RegAccessMode::READWRITE) == RegError::NO_ERROR)
|
||||
{
|
||||
pReg.reset();
|
||||
|
||||
@@ -558,17 +558,17 @@ RegError ORegistry::destroyRegistry(const OUString& regName)
|
||||
OString name( OUStringToOString(systemName, osl_getThreadTextEncoding()) );
|
||||
if (unlink(name.getStr()) != 0)
|
||||
{
|
||||
return REG_DESTROY_REGISTRY_FAILED;
|
||||
return RegError::DESTROY_REGISTRY_FAILED;
|
||||
}
|
||||
} else
|
||||
{
|
||||
return REG_DESTROY_REGISTRY_FAILED;
|
||||
return RegError::DESTROY_REGISTRY_FAILED;
|
||||
}
|
||||
} else
|
||||
{
|
||||
if (m_refCount != 1 || isReadOnly())
|
||||
{
|
||||
return REG_DESTROY_REGISTRY_FAILED;
|
||||
return RegError::DESTROY_REGISTRY_FAILED;
|
||||
}
|
||||
|
||||
if (m_file.isValid())
|
||||
@@ -586,16 +586,16 @@ RegError ORegistry::destroyRegistry(const OUString& regName)
|
||||
OString name( OUStringToOString(systemName, osl_getThreadTextEncoding()) );
|
||||
if (unlink(name.getStr()) != 0)
|
||||
{
|
||||
return REG_DESTROY_REGISTRY_FAILED;
|
||||
return RegError::DESTROY_REGISTRY_FAILED;
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
return REG_REGISTRY_NOT_EXISTS;
|
||||
return RegError::REGISTRY_NOT_EXISTS;
|
||||
}
|
||||
}
|
||||
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -605,12 +605,12 @@ RegError ORegistry::acquireKey (RegKeyHandle hKey)
|
||||
{
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
REG_GUARD(m_mutex);
|
||||
pKey->acquire();
|
||||
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -620,7 +620,7 @@ RegError ORegistry::releaseKey (RegKeyHandle hKey)
|
||||
{
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
REG_GUARD(m_mutex);
|
||||
if (pKey->release() == 0)
|
||||
@@ -628,7 +628,7 @@ RegError ORegistry::releaseKey (RegKeyHandle hKey)
|
||||
m_openKeyTable.erase(pKey->getName());
|
||||
delete pKey;
|
||||
}
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -642,7 +642,7 @@ RegError ORegistry::createKey(RegKeyHandle hKey, const OUString& keyName,
|
||||
*phNewKey = NULL;
|
||||
|
||||
if ( keyName.isEmpty() )
|
||||
return REG_INVALID_KEYNAME;
|
||||
return RegError::INVALID_KEYNAME;
|
||||
|
||||
REG_GUARD(m_mutex);
|
||||
|
||||
@@ -658,7 +658,7 @@ RegError ORegistry::createKey(RegKeyHandle hKey, const OUString& keyName,
|
||||
*phNewKey = m_openKeyTable[sFullKeyName];
|
||||
static_cast<ORegKey*>(*phNewKey)->acquire();
|
||||
static_cast<ORegKey*>(*phNewKey)->setDeleted(false);
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
OStoreDirectory rStoreDir;
|
||||
@@ -675,7 +675,7 @@ RegError ORegistry::createKey(RegKeyHandle hKey, const OUString& keyName,
|
||||
{
|
||||
if (rStoreDir.create(pKey->getStoreFile(), sFullPath.getStr(), token, KEY_MODE_CREATE))
|
||||
{
|
||||
return REG_CREATE_KEY_FAILED;
|
||||
return RegError::CREATE_KEY_FAILED;
|
||||
}
|
||||
|
||||
sFullPath.append(token);
|
||||
@@ -688,7 +688,7 @@ RegError ORegistry::createKey(RegKeyHandle hKey, const OUString& keyName,
|
||||
*phNewKey = pKey;
|
||||
m_openKeyTable[sFullKeyName] = pKey;
|
||||
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -704,7 +704,7 @@ RegError ORegistry::openKey(RegKeyHandle hKey, const OUString& keyName,
|
||||
|
||||
if ( keyName.isEmpty() )
|
||||
{
|
||||
return REG_INVALID_KEYNAME;
|
||||
return RegError::INVALID_KEYNAME;
|
||||
}
|
||||
|
||||
REG_GUARD(m_mutex);
|
||||
@@ -723,9 +723,9 @@ RegError ORegistry::openKey(RegKeyHandle hKey, const OUString& keyName,
|
||||
isReadOnly() ? KEY_MODE_OPENREAD : KEY_MODE_OPEN))
|
||||
{
|
||||
case store_E_NotExists:
|
||||
return REG_KEY_NOT_EXISTS;
|
||||
return RegError::KEY_NOT_EXISTS;
|
||||
case store_E_WrongFormat:
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -737,7 +737,7 @@ RegError ORegistry::openKey(RegKeyHandle hKey, const OUString& keyName,
|
||||
i->second->acquire();
|
||||
}
|
||||
*phOpenKey = i->second;
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -752,7 +752,7 @@ RegError ORegistry::closeKey(RegKeyHandle hKey)
|
||||
|
||||
OUString const aKeyName (pKey->getName());
|
||||
if (!(m_openKeyTable.count(aKeyName) > 0))
|
||||
return REG_KEY_NOT_OPEN;
|
||||
return RegError::KEY_NOT_OPEN;
|
||||
|
||||
if (pKey->isModified())
|
||||
{
|
||||
@@ -782,7 +782,7 @@ RegError ORegistry::deleteKey(RegKeyHandle hKey, const OUString& keyName)
|
||||
{
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if ( keyName.isEmpty() )
|
||||
return REG_INVALID_KEYNAME;
|
||||
return RegError::INVALID_KEYNAME;
|
||||
|
||||
REG_GUARD(m_mutex);
|
||||
|
||||
@@ -795,11 +795,11 @@ RegError ORegistry::deleteKey(RegKeyHandle hKey, const OUString& keyName)
|
||||
|
||||
RegError ORegistry::eraseKey(ORegKey* pKey, const OUString& keyName)
|
||||
{
|
||||
RegError _ret = REG_NO_ERROR;
|
||||
RegError _ret = RegError::NO_ERROR;
|
||||
|
||||
if ( keyName.isEmpty() )
|
||||
{
|
||||
return REG_INVALID_KEYNAME;
|
||||
return RegError::INVALID_KEYNAME;
|
||||
}
|
||||
|
||||
OUString sFullKeyName(pKey->getName());
|
||||
@@ -831,11 +831,11 @@ RegError ORegistry::eraseKey(ORegKey* pKey, const OUString& keyName)
|
||||
|
||||
ORegKey* pOldKey = 0;
|
||||
_ret = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pOldKey));
|
||||
if (_ret != REG_NO_ERROR)
|
||||
if (_ret != RegError::NO_ERROR)
|
||||
return _ret;
|
||||
|
||||
_ret = deleteSubkeysAndValues(pOldKey);
|
||||
if (_ret != REG_NO_ERROR)
|
||||
if (_ret != RegError::NO_ERROR)
|
||||
{
|
||||
pKey->closeKey(pOldKey);
|
||||
return _ret;
|
||||
@@ -847,7 +847,7 @@ RegError ORegistry::eraseKey(ORegKey* pKey, const OUString& keyName)
|
||||
OStoreFile sFile(pKey->getStoreFile());
|
||||
if ( sFile.isValid() && sFile.remove(sFullPath, tmpName) )
|
||||
{
|
||||
return REG_DELETE_KEY_FAILED;
|
||||
return RegError::DELETE_KEY_FAILED;
|
||||
}
|
||||
pOldKey->setModified();
|
||||
|
||||
@@ -863,7 +863,7 @@ RegError ORegistry::eraseKey(ORegKey* pKey, const OUString& keyName)
|
||||
RegError ORegistry::deleteSubkeysAndValues(ORegKey* pKey)
|
||||
{
|
||||
OStoreDirectory::iterator iter;
|
||||
RegError _ret = REG_NO_ERROR;
|
||||
RegError _ret = RegError::NO_ERROR;
|
||||
OStoreDirectory rStoreDir(pKey->getStoreDir());
|
||||
storeError _err = rStoreDir.first(iter);
|
||||
|
||||
@@ -874,7 +874,7 @@ RegError ORegistry::deleteSubkeysAndValues(ORegKey* pKey)
|
||||
if (iter.m_nAttrib & STORE_ATTRIB_ISDIR)
|
||||
{
|
||||
_ret = eraseKey(pKey, keyName);
|
||||
if (_ret)
|
||||
if (_ret != RegError::NO_ERROR)
|
||||
return _ret;
|
||||
}
|
||||
else
|
||||
@@ -886,7 +886,7 @@ RegError ORegistry::deleteSubkeysAndValues(ORegKey* pKey)
|
||||
|
||||
if ( ((OStoreFile&)pKey->getStoreFile()).remove(sFullPath, keyName) )
|
||||
{
|
||||
return REG_DELETE_VALUE_FAILED;
|
||||
return RegError::DELETE_VALUE_FAILED;
|
||||
}
|
||||
pKey->setModified();
|
||||
}
|
||||
@@ -894,7 +894,7 @@ RegError ORegistry::deleteSubkeysAndValues(ORegKey* pKey)
|
||||
_err = rStoreDir.next(iter);
|
||||
}
|
||||
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -904,12 +904,12 @@ RegError ORegistry::deleteSubkeysAndValues(ORegKey* pKey)
|
||||
RegError ORegistry::loadKey(RegKeyHandle hKey, const OUString& regFileName,
|
||||
bool bWarnings, bool bReport)
|
||||
{
|
||||
RegError _ret = REG_NO_ERROR;
|
||||
RegError _ret = RegError::NO_ERROR;
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
|
||||
std::unique_ptr< ORegistry > pReg (new ORegistry());
|
||||
_ret = pReg->initRegistry(regFileName, RegAccessMode::READONLY);
|
||||
if (_ret != REG_NO_ERROR)
|
||||
if (_ret != RegError::NO_ERROR)
|
||||
return _ret;
|
||||
ORegKey* pRootKey = pReg->getRootKey();
|
||||
|
||||
@@ -932,9 +932,9 @@ RegError ORegistry::loadKey(RegKeyHandle hKey, const OUString& regFileName,
|
||||
_ret = loadAndSaveValue(pKey, pRootKey, keyName, 0, bWarnings, bReport);
|
||||
}
|
||||
|
||||
if (_ret == REG_MERGE_ERROR)
|
||||
if (_ret == RegError::MERGE_ERROR)
|
||||
break;
|
||||
if (_ret == REG_MERGE_CONFLICT && bWarnings)
|
||||
if (_ret == RegError::MERGE_CONFLICT && bWarnings)
|
||||
break;
|
||||
|
||||
_err = rStoreDir.next(iter);
|
||||
@@ -952,12 +952,12 @@ RegError ORegistry::loadKey(RegKeyHandle hKey, const OUString& regFileName,
|
||||
RegError ORegistry::saveKey(RegKeyHandle hKey, const OUString& regFileName,
|
||||
bool bWarnings, bool bReport)
|
||||
{
|
||||
RegError _ret = REG_NO_ERROR;
|
||||
RegError _ret = RegError::NO_ERROR;
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
|
||||
std::unique_ptr< ORegistry > pReg (new ORegistry());
|
||||
_ret = pReg->initRegistry(regFileName, RegAccessMode::READWRITE, true/*bCreate*/);
|
||||
if (_ret != REG_NO_ERROR)
|
||||
if (_ret != RegError::NO_ERROR)
|
||||
return _ret;
|
||||
ORegKey* pRootKey = pReg->getRootKey();
|
||||
|
||||
@@ -984,7 +984,7 @@ RegError ORegistry::saveKey(RegKeyHandle hKey, const OUString& regFileName,
|
||||
bWarnings, bReport);
|
||||
}
|
||||
|
||||
if (_ret != REG_NO_ERROR)
|
||||
if (_ret != RegError::NO_ERROR)
|
||||
break;
|
||||
|
||||
_err = rStoreDir.next(iter);
|
||||
@@ -1037,7 +1037,7 @@ RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey,
|
||||
|
||||
if (rValue.create(pSourceKey->getStoreFile(), sSourcePath, valueName, sourceAccess))
|
||||
{
|
||||
return REG_VALUE_NOT_EXISTS;
|
||||
return RegError::VALUE_NOT_EXISTS;
|
||||
}
|
||||
|
||||
pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE));
|
||||
@@ -1046,15 +1046,15 @@ RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey,
|
||||
if (rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, rwBytes))
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
if (rwBytes != VALUE_HEADERSIZE)
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
RegError _ret = REG_NO_ERROR;
|
||||
RegError _ret = RegError::NO_ERROR;
|
||||
sal_uInt8 type = *((sal_uInt8*)pBuffer);
|
||||
valueType = (RegValueType)type;
|
||||
readUINT32(pBuffer+VALUE_TYPEOFFSET, valueSize);
|
||||
@@ -1066,12 +1066,12 @@ RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey,
|
||||
if (rValue.readAt(0, pBuffer, nSize, rwBytes))
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
if (rwBytes != nSize)
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
OStoreFile rTargetFile(pTargetKey->getStoreFile());
|
||||
@@ -1083,10 +1083,10 @@ RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey,
|
||||
_ret = checkBlop(
|
||||
rValue, sTargetPath, valueSize, pBuffer+VALUE_HEADEROFFSET,
|
||||
bReport);
|
||||
if (_ret)
|
||||
if (_ret != RegError::NO_ERROR)
|
||||
{
|
||||
if (_ret == REG_MERGE_ERROR ||
|
||||
(_ret == REG_MERGE_CONFLICT && bWarnings))
|
||||
if (_ret == RegError::MERGE_ERROR ||
|
||||
(_ret == RegError::MERGE_CONFLICT && bWarnings))
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return _ret;
|
||||
@@ -1103,18 +1103,18 @@ RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey,
|
||||
if (rValue.create(rTargetFile, sTargetPath, valueName, VALUE_MODE_CREATE))
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
if (rValue.writeAt(0, pBuffer, nSize, rwBytes))
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
if (rwBytes != nSize)
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
pTargetKey->setModified();
|
||||
|
||||
@@ -1136,7 +1136,7 @@ RegError ORegistry::checkBlop(OStoreStream& rValue,
|
||||
|
||||
if (reader.getTypeClass() == RT_TYPE_INVALID)
|
||||
{
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
sal_uInt8* pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE));
|
||||
@@ -1171,7 +1171,7 @@ RegError ORegistry::checkBlop(OStoreStream& rValue,
|
||||
fprintf(stdout, "ERROR: values of blop from key \"%s\" has different types.\n",
|
||||
targetPath.getStr());
|
||||
}
|
||||
return REG_MERGE_ERROR;
|
||||
return RegError::MERGE_ERROR;
|
||||
}
|
||||
|
||||
if (reader.getTypeClass() == RT_TYPE_MODULE)
|
||||
@@ -1182,16 +1182,16 @@ RegError ORegistry::checkBlop(OStoreStream& rValue,
|
||||
mergeModuleValue(rValue, reader, reader2);
|
||||
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
} else
|
||||
if (reader2.getFieldCount() > 0)
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
} else
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_MERGE_CONFLICT;
|
||||
return RegError::MERGE_CONFLICT;
|
||||
}
|
||||
} else
|
||||
{
|
||||
@@ -1202,7 +1202,7 @@ RegError ORegistry::checkBlop(OStoreStream& rValue,
|
||||
fprintf(stderr, "WARNING: value of key \"%s\" already exists.\n",
|
||||
targetPath.getStr());
|
||||
}
|
||||
return REG_MERGE_CONFLICT;
|
||||
return RegError::MERGE_CONFLICT;
|
||||
}
|
||||
} else
|
||||
{
|
||||
@@ -1212,7 +1212,7 @@ RegError ORegistry::checkBlop(OStoreStream& rValue,
|
||||
fprintf(stderr, "ERROR: values of key \"%s\" contains bad data.\n",
|
||||
targetPath.getStr());
|
||||
}
|
||||
return REG_MERGE_ERROR;
|
||||
return RegError::MERGE_ERROR;
|
||||
}
|
||||
} else
|
||||
{
|
||||
@@ -1222,12 +1222,12 @@ RegError ORegistry::checkBlop(OStoreStream& rValue,
|
||||
fprintf(stderr, "ERROR: values of key \"%s\" has different types.\n",
|
||||
targetPath.getStr());
|
||||
}
|
||||
return REG_MERGE_ERROR;
|
||||
return RegError::MERGE_ERROR;
|
||||
}
|
||||
} else
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1314,18 +1314,18 @@ RegError ORegistry::mergeModuleValue(OStoreStream& rTargetValue,
|
||||
if (rTargetValue.writeAt(0, pBuffer, VALUE_HEADERSIZE+aBlopSize, rwBytes))
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
if (rwBytes != VALUE_HEADERSIZE+aBlopSize)
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
rtl_freeMemory(pBuffer);
|
||||
}
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -1338,7 +1338,7 @@ RegError ORegistry::loadAndSaveKeys(ORegKey* pTargetKey,
|
||||
bool bWarnings,
|
||||
bool bReport)
|
||||
{
|
||||
RegError _ret = REG_NO_ERROR;
|
||||
RegError _ret = RegError::NO_ERROR;
|
||||
OUString sRelPath(pSourceKey->getName().copy(nCut));
|
||||
OUString sFullPath;
|
||||
|
||||
@@ -1354,7 +1354,7 @@ RegError ORegistry::loadAndSaveKeys(ORegKey* pTargetKey,
|
||||
OStoreDirectory rStoreDir;
|
||||
if (rStoreDir.create(pTargetKey->getStoreFile(), sFullPath, keyName, KEY_MODE_CREATE))
|
||||
{
|
||||
return REG_CREATE_KEY_FAILED;
|
||||
return RegError::CREATE_KEY_FAILED;
|
||||
}
|
||||
|
||||
if (m_openKeyTable.count(sFullKeyName) > 0)
|
||||
@@ -1364,7 +1364,7 @@ RegError ORegistry::loadAndSaveKeys(ORegKey* pTargetKey,
|
||||
|
||||
ORegKey* pTmpKey = 0;
|
||||
_ret = pSourceKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pTmpKey));
|
||||
if (_ret != REG_NO_ERROR)
|
||||
if (_ret != RegError::NO_ERROR)
|
||||
return _ret;
|
||||
|
||||
OStoreDirectory::iterator iter;
|
||||
@@ -1385,9 +1385,9 @@ RegError ORegistry::loadAndSaveKeys(ORegKey* pTargetKey,
|
||||
sName, nCut, bWarnings, bReport);
|
||||
}
|
||||
|
||||
if (_ret == REG_MERGE_ERROR)
|
||||
if (_ret == RegError::MERGE_ERROR)
|
||||
break;
|
||||
if (_ret == REG_MERGE_CONFLICT && bWarnings)
|
||||
if (_ret == RegError::MERGE_CONFLICT && bWarnings)
|
||||
break;
|
||||
|
||||
_err = rTmpStoreDir.next(iter);
|
||||
@@ -1415,7 +1415,7 @@ RegError ORegistry::dumpRegistry(RegKeyHandle hKey) const
|
||||
{
|
||||
ORegKey *pKey = static_cast<ORegKey*>(hKey);
|
||||
OUString sName;
|
||||
RegError _ret = REG_NO_ERROR;
|
||||
RegError _ret = RegError::NO_ERROR;
|
||||
OStoreDirectory::iterator iter;
|
||||
OStoreDirectory rStoreDir(pKey->getStoreDir());
|
||||
storeError _err = rStoreDir.first(iter);
|
||||
@@ -1436,7 +1436,7 @@ RegError ORegistry::dumpRegistry(RegKeyHandle hKey) const
|
||||
_ret = dumpValue(pKey->getName(), sName, 1);
|
||||
}
|
||||
|
||||
if (_ret)
|
||||
if (_ret != RegError::NO_ERROR)
|
||||
{
|
||||
return _ret;
|
||||
}
|
||||
@@ -1444,7 +1444,7 @@ RegError ORegistry::dumpRegistry(RegKeyHandle hKey) const
|
||||
_err = rStoreDir.next(iter);
|
||||
}
|
||||
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -1473,7 +1473,7 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_
|
||||
}
|
||||
if (rValue.create(m_file, sFullPath, sName, accessMode))
|
||||
{
|
||||
return REG_VALUE_NOT_EXISTS;
|
||||
return RegError::VALUE_NOT_EXISTS;
|
||||
}
|
||||
|
||||
pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE));
|
||||
@@ -1482,12 +1482,12 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_
|
||||
if (rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, rwBytes))
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
if (rwBytes != (VALUE_HEADERSIZE))
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
sal_uInt8 type = *((sal_uInt8*)pBuffer);
|
||||
@@ -1498,12 +1498,12 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_
|
||||
if (rValue.readAt(VALUE_HEADEROFFSET, pBuffer, valueSize, rwBytes))
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
if (rwBytes != valueSize)
|
||||
{
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
const sal_Char* indent = sIndent.getStr();
|
||||
@@ -1683,7 +1683,7 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_
|
||||
fprintf(stdout, "\n");
|
||||
|
||||
rtl_freeMemory(pBuffer);
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -1695,7 +1695,7 @@ RegError ORegistry::dumpKey(const OUString& sPath, const OUString& sName, sal_In
|
||||
OUString sFullPath(sPath);
|
||||
OString sIndent;
|
||||
storeAccessMode accessMode = KEY_MODE_OPEN;
|
||||
RegError _ret = REG_NO_ERROR;
|
||||
RegError _ret = RegError::NO_ERROR;
|
||||
|
||||
if (isReadOnly())
|
||||
{
|
||||
@@ -1710,9 +1710,9 @@ RegError ORegistry::dumpKey(const OUString& sPath, const OUString& sName, sal_In
|
||||
storeError _err = rStoreDir.create(m_file, sFullPath, sName, accessMode);
|
||||
|
||||
if (_err == store_E_NotExists)
|
||||
return REG_KEY_NOT_EXISTS;
|
||||
return RegError::KEY_NOT_EXISTS;
|
||||
else if (_err == store_E_WrongFormat)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
fprintf(stdout, "%s/ %s\n", sIndent.getStr(), OUStringToOString(sName, RTL_TEXTENCODING_UTF8).getStr());
|
||||
|
||||
@@ -1736,7 +1736,7 @@ RegError ORegistry::dumpKey(const OUString& sPath, const OUString& sName, sal_In
|
||||
_ret = dumpValue(sSubPath, sSubName, nSpace+2);
|
||||
}
|
||||
|
||||
if (_ret)
|
||||
if (_ret != RegError::NO_ERROR)
|
||||
{
|
||||
return _ret;
|
||||
}
|
||||
@@ -1744,7 +1744,7 @@ RegError ORegistry::dumpKey(const OUString& sPath, const OUString& sName, sal_In
|
||||
_err = rStoreDir.next(iter);
|
||||
}
|
||||
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
@@ -80,16 +80,16 @@ static RegError REGISTRY_CALLTYPE getName(RegHandle hReg, rtl_uString** pName)
|
||||
if ( pReg->isOpen() )
|
||||
{
|
||||
rtl_uString_assign(pName, pReg->getName().pData);
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
} else
|
||||
{
|
||||
rtl_uString_new(pName);
|
||||
return REG_REGISTRY_NOT_OPEN;
|
||||
return RegError::REGISTRY_NOT_OPEN;
|
||||
}
|
||||
}
|
||||
|
||||
rtl_uString_new(pName);
|
||||
return REG_INVALID_REGISTRY;
|
||||
return RegError::INVALID_REGISTRY;
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ static RegError REGISTRY_CALLTYPE createRegistry(rtl_uString* registryName,
|
||||
RegError ret;
|
||||
|
||||
ORegistry* pReg = new ORegistry();
|
||||
if ((ret = pReg->initRegistry(registryName, RegAccessMode::READWRITE, true/*bCreate*/)))
|
||||
if ((ret = pReg->initRegistry(registryName, RegAccessMode::READWRITE, true/*bCreate*/)) != RegError::NO_ERROR)
|
||||
{
|
||||
delete pReg;
|
||||
*phRegistry = NULL;
|
||||
@@ -123,7 +123,7 @@ static RegError REGISTRY_CALLTYPE createRegistry(rtl_uString* registryName,
|
||||
|
||||
*phRegistry = pReg;
|
||||
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -138,16 +138,16 @@ static RegError REGISTRY_CALLTYPE openRootKey(RegHandle hReg,
|
||||
{
|
||||
pReg = static_cast<ORegistry*>(hReg);
|
||||
if (!pReg->isOpen())
|
||||
return REG_REGISTRY_NOT_OPEN;
|
||||
return RegError::REGISTRY_NOT_OPEN;
|
||||
} else
|
||||
{
|
||||
phRootKey = NULL;
|
||||
return REG_INVALID_REGISTRY;
|
||||
return RegError::INVALID_REGISTRY;
|
||||
}
|
||||
|
||||
*phRootKey = pReg->getRootKey();
|
||||
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ static RegError REGISTRY_CALLTYPE openRegistry(rtl_uString* registryName,
|
||||
RegError _ret;
|
||||
|
||||
ORegistry* pReg = new ORegistry();
|
||||
if ((_ret = pReg->initRegistry(registryName, accessMode)))
|
||||
if ((_ret = pReg->initRegistry(registryName, accessMode)) != RegError::NO_ERROR)
|
||||
{
|
||||
*phRegistry = NULL;
|
||||
delete pReg;
|
||||
@@ -171,7 +171,7 @@ static RegError REGISTRY_CALLTYPE openRegistry(rtl_uString* registryName,
|
||||
|
||||
*phRegistry = pReg;
|
||||
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -185,9 +185,9 @@ static RegError REGISTRY_CALLTYPE closeRegistry(RegHandle hReg)
|
||||
{
|
||||
pReg = static_cast<ORegistry*>(hReg);
|
||||
if (!pReg->isOpen())
|
||||
return REG_REGISTRY_NOT_OPEN;
|
||||
return RegError::REGISTRY_NOT_OPEN;
|
||||
|
||||
RegError ret = REG_NO_ERROR;
|
||||
RegError ret = RegError::NO_ERROR;
|
||||
if (pReg->release() == 0)
|
||||
{
|
||||
delete(pReg);
|
||||
@@ -199,7 +199,7 @@ static RegError REGISTRY_CALLTYPE closeRegistry(RegHandle hReg)
|
||||
return ret;
|
||||
} else
|
||||
{
|
||||
return REG_INVALID_REGISTRY;
|
||||
return RegError::INVALID_REGISTRY;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,10 +216,10 @@ static RegError REGISTRY_CALLTYPE destroyRegistry(RegHandle hReg,
|
||||
{
|
||||
pReg = static_cast<ORegistry*>(hReg);
|
||||
if (!pReg->isOpen())
|
||||
return REG_INVALID_REGISTRY;
|
||||
return RegError::INVALID_REGISTRY;
|
||||
|
||||
RegError ret = pReg->destroyRegistry(registryName);
|
||||
if (!ret)
|
||||
if (ret == RegError::NO_ERROR)
|
||||
{
|
||||
if (!registryName->length)
|
||||
{
|
||||
@@ -230,7 +230,7 @@ static RegError REGISTRY_CALLTYPE destroyRegistry(RegHandle hReg,
|
||||
return ret;
|
||||
} else
|
||||
{
|
||||
return REG_INVALID_REGISTRY;
|
||||
return RegError::INVALID_REGISTRY;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,37 +246,37 @@ static RegError REGISTRY_CALLTYPE loadKey(RegHandle hReg,
|
||||
|
||||
ORegistry* pReg = static_cast< ORegistry* >(hReg);
|
||||
if (!pReg)
|
||||
return REG_INVALID_REGISTRY;
|
||||
return RegError::INVALID_REGISTRY;
|
||||
|
||||
if (!pReg->isOpen())
|
||||
return REG_REGISTRY_NOT_OPEN;
|
||||
return RegError::REGISTRY_NOT_OPEN;
|
||||
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->getRegistry() != pReg)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
if (pKey->isDeleted())
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
if (pKey->isReadOnly())
|
||||
return REG_REGISTRY_READONLY;
|
||||
return RegError::REGISTRY_READONLY;
|
||||
|
||||
|
||||
ORegKey* pNewKey = 0;
|
||||
RegError _ret = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pNewKey));
|
||||
if (_ret == REG_NO_ERROR)
|
||||
if (_ret == RegError::NO_ERROR)
|
||||
{
|
||||
pKey->releaseKey(pNewKey);
|
||||
pKey->deleteKey(keyName);
|
||||
}
|
||||
|
||||
_ret = pKey->createKey(keyName, reinterpret_cast<RegKeyHandle*>(&pNewKey));
|
||||
if (_ret != REG_NO_ERROR)
|
||||
if (_ret != RegError::NO_ERROR)
|
||||
return _ret;
|
||||
|
||||
_ret = pReg->loadKey(pNewKey, regFileName);
|
||||
if (_ret != REG_NO_ERROR)
|
||||
if (_ret != RegError::NO_ERROR)
|
||||
{
|
||||
pKey->releaseKey(pNewKey);
|
||||
pKey->deleteKey(keyName);
|
||||
@@ -297,27 +297,27 @@ static RegError REGISTRY_CALLTYPE saveKey(RegHandle hReg,
|
||||
|
||||
ORegistry* pReg = static_cast< ORegistry* >(hReg);
|
||||
if (!pReg)
|
||||
return REG_INVALID_REGISTRY;
|
||||
return RegError::INVALID_REGISTRY;
|
||||
|
||||
if (!pReg->isOpen())
|
||||
return REG_REGISTRY_NOT_OPEN;
|
||||
return RegError::REGISTRY_NOT_OPEN;
|
||||
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->getRegistry() != pReg)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
if (pKey->isDeleted())
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
ORegKey* pNewKey = 0;
|
||||
RegError _ret = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pNewKey));
|
||||
if (_ret != REG_NO_ERROR)
|
||||
if (_ret != RegError::NO_ERROR)
|
||||
return _ret;
|
||||
|
||||
_ret = pReg->saveKey(pNewKey, regFileName);
|
||||
if (_ret != REG_NO_ERROR)
|
||||
if (_ret != RegError::NO_ERROR)
|
||||
{
|
||||
(void) pKey->releaseKey(pNewKey);
|
||||
return _ret;
|
||||
@@ -338,29 +338,29 @@ static RegError REGISTRY_CALLTYPE mergeKey(RegHandle hReg,
|
||||
{
|
||||
ORegistry* pReg = static_cast< ORegistry* >(hReg);
|
||||
if (!pReg)
|
||||
return REG_INVALID_REGISTRY;
|
||||
return RegError::INVALID_REGISTRY;
|
||||
if (!pReg->isOpen())
|
||||
return REG_REGISTRY_NOT_OPEN;
|
||||
return RegError::REGISTRY_NOT_OPEN;
|
||||
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
if (pKey->getRegistry() != pReg)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
if (pKey->isDeleted())
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
if (pKey->isReadOnly())
|
||||
return REG_REGISTRY_READONLY;
|
||||
return RegError::REGISTRY_READONLY;
|
||||
|
||||
if (keyName->length)
|
||||
{
|
||||
ORegKey* pNewKey = 0;
|
||||
RegError _ret = pKey->createKey(keyName, reinterpret_cast<RegKeyHandle*>(&pNewKey));
|
||||
if (_ret != REG_NO_ERROR)
|
||||
if (_ret != RegError::NO_ERROR)
|
||||
return _ret;
|
||||
|
||||
_ret = pReg->loadKey(pNewKey, regFileName, bWarnings, bReport);
|
||||
if (_ret != REG_NO_ERROR && (_ret != REG_MERGE_CONFLICT || bWarnings))
|
||||
if (_ret != RegError::NO_ERROR && (_ret != RegError::MERGE_CONFLICT || bWarnings))
|
||||
{
|
||||
if (pNewKey != pKey)
|
||||
(void) pKey->closeKey(pNewKey);
|
||||
@@ -383,17 +383,17 @@ static RegError REGISTRY_CALLTYPE dumpRegistry(RegHandle hReg,
|
||||
{
|
||||
ORegistry* pReg = static_cast< ORegistry* >(hReg);
|
||||
if (!pReg)
|
||||
return REG_INVALID_REGISTRY;
|
||||
return RegError::INVALID_REGISTRY;
|
||||
if (!pReg->isOpen())
|
||||
return REG_REGISTRY_NOT_OPEN;
|
||||
return RegError::REGISTRY_NOT_OPEN;
|
||||
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
if (pKey->getRegistry() != pReg)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
if (pKey->isDeleted())
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return pReg->dumpRegistry(hKey);
|
||||
}
|
||||
@@ -457,7 +457,7 @@ RegError REGISTRY_CALLTYPE reg_loadKey(RegKeyHandle hKey,
|
||||
if (hKey)
|
||||
pKey = static_cast<ORegKey*>(hKey);
|
||||
else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return loadKey(pKey->getRegistry(), hKey, keyName, regFileName);
|
||||
}
|
||||
@@ -474,7 +474,7 @@ RegError REGISTRY_CALLTYPE reg_saveKey(RegKeyHandle hKey,
|
||||
if (hKey)
|
||||
pKey = static_cast<ORegKey*>(hKey);
|
||||
else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return saveKey(pKey->getRegistry(), hKey, keyName, regFileName);
|
||||
}
|
||||
@@ -493,7 +493,7 @@ RegError REGISTRY_CALLTYPE reg_mergeKey(RegKeyHandle hKey,
|
||||
if (hKey)
|
||||
pKey = static_cast<ORegKey*>(hKey);
|
||||
else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return mergeKey(pKey->getRegistry(), hKey, keyName, regFileName, bWarnings, bReport);
|
||||
}
|
||||
@@ -507,7 +507,7 @@ RegError REGISTRY_CALLTYPE reg_createRegistry(rtl_uString* registryName,
|
||||
RegError ret;
|
||||
|
||||
ORegistry* pReg = new ORegistry();
|
||||
if ((ret = pReg->initRegistry(registryName, RegAccessMode::READWRITE, true/*bCreate*/)))
|
||||
if ((ret = pReg->initRegistry(registryName, RegAccessMode::READWRITE, true/*bCreate*/)) != RegError::NO_ERROR)
|
||||
{
|
||||
delete pReg;
|
||||
*phRegistry = NULL;
|
||||
@@ -516,7 +516,7 @@ RegError REGISTRY_CALLTYPE reg_createRegistry(rtl_uString* registryName,
|
||||
|
||||
*phRegistry = pReg;
|
||||
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -557,7 +557,7 @@ RegError REGISTRY_CALLTYPE reg_openRegistry(rtl_uString* registryName,
|
||||
RegError _ret;
|
||||
|
||||
ORegistry* pReg = new ORegistry();
|
||||
if ((_ret = pReg->initRegistry(registryName, accessMode)))
|
||||
if ((_ret = pReg->initRegistry(registryName, accessMode)) != RegError::NO_ERROR)
|
||||
{
|
||||
delete pReg;
|
||||
*phRegistry = NULL;
|
||||
@@ -566,7 +566,7 @@ RegError REGISTRY_CALLTYPE reg_openRegistry(rtl_uString* registryName,
|
||||
|
||||
*phRegistry = pReg;
|
||||
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -578,10 +578,10 @@ RegError REGISTRY_CALLTYPE reg_closeRegistry(RegHandle hRegistry)
|
||||
{
|
||||
ORegistry* pReg = static_cast<ORegistry*>(hRegistry);
|
||||
delete(pReg);
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
} else
|
||||
{
|
||||
return REG_REGISTRY_NOT_OPEN;
|
||||
return RegError::REGISTRY_NOT_OPEN;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -606,7 +606,7 @@ RegError REGISTRY_CALLTYPE reg_dumpRegistry(RegKeyHandle hKey)
|
||||
if (hKey)
|
||||
pKey = static_cast<ORegKey*>(hKey);
|
||||
else
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return dumpRegistry(pKey->getRegistry(), hKey);
|
||||
}
|
||||
|
@@ -74,11 +74,11 @@ RegError REGISTRY_CALLTYPE getKeyName(RegKeyHandle hKey, rtl_uString** pKeyName)
|
||||
if (pKey)
|
||||
{
|
||||
rtl_uString_assign( pKeyName, pKey->getName().pData );
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
} else
|
||||
{
|
||||
rtl_uString_new(pKeyName);
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,13 +94,13 @@ RegError REGISTRY_CALLTYPE createKey(RegKeyHandle hKey,
|
||||
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->isDeleted())
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->isReadOnly())
|
||||
return REG_REGISTRY_READONLY;
|
||||
return RegError::REGISTRY_READONLY;
|
||||
|
||||
return pKey->createKey(keyName, phNewKey);
|
||||
}
|
||||
@@ -116,10 +116,10 @@ RegError REGISTRY_CALLTYPE openKey(RegKeyHandle hKey,
|
||||
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->isDeleted())
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return pKey->openKey(keyName, phOpenKey);
|
||||
}
|
||||
@@ -137,10 +137,10 @@ RegError REGISTRY_CALLTYPE openSubKeys(RegKeyHandle hKey,
|
||||
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->isDeleted())
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return pKey->openSubKeys(keyName, pphSubKeys, pnSubKeys);
|
||||
}
|
||||
@@ -152,7 +152,7 @@ RegError REGISTRY_CALLTYPE closeSubKeys(RegKeyHandle* phSubKeys,
|
||||
sal_uInt32 nSubKeys)
|
||||
{
|
||||
if (phSubKeys == 0 || nSubKeys == 0)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
ORegistry* pReg = static_cast<ORegKey*>(phSubKeys[0])->getRegistry();
|
||||
for (sal_uInt32 i = 0; i < nSubKeys; i++)
|
||||
@@ -161,7 +161,7 @@ RegError REGISTRY_CALLTYPE closeSubKeys(RegKeyHandle* phSubKeys,
|
||||
}
|
||||
rtl_freeMemory(phSubKeys);
|
||||
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -172,13 +172,13 @@ RegError REGISTRY_CALLTYPE deleteKey(RegKeyHandle hKey,
|
||||
{
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->isDeleted())
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->isReadOnly())
|
||||
return REG_REGISTRY_READONLY;
|
||||
return RegError::REGISTRY_READONLY;
|
||||
|
||||
return pKey->deleteKey(keyName);
|
||||
}
|
||||
@@ -190,7 +190,7 @@ RegError REGISTRY_CALLTYPE closeKey(RegKeyHandle hKey)
|
||||
{
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return pKey->closeKey(hKey);
|
||||
}
|
||||
@@ -206,27 +206,27 @@ RegError REGISTRY_CALLTYPE setValue(RegKeyHandle hKey,
|
||||
{
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->isDeleted())
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->isReadOnly())
|
||||
return REG_REGISTRY_READONLY;
|
||||
return RegError::REGISTRY_READONLY;
|
||||
|
||||
OUString valueName("value");
|
||||
if (keyName->length)
|
||||
{
|
||||
ORegKey* pSubKey = 0;
|
||||
RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey));
|
||||
if (_ret1 != REG_NO_ERROR)
|
||||
if (_ret1 != RegError::NO_ERROR)
|
||||
return _ret1;
|
||||
|
||||
_ret1 = pSubKey->setValue(valueName, valueType, pData, valueSize);
|
||||
if (_ret1 != REG_NO_ERROR)
|
||||
if (_ret1 != RegError::NO_ERROR)
|
||||
{
|
||||
RegError _ret2 = pKey->closeKey(pSubKey);
|
||||
if (_ret2)
|
||||
if (_ret2 != RegError::NO_ERROR)
|
||||
return _ret2;
|
||||
else
|
||||
return _ret1;
|
||||
@@ -248,27 +248,27 @@ RegError REGISTRY_CALLTYPE setLongListValue(RegKeyHandle hKey,
|
||||
{
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->isDeleted())
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->isReadOnly())
|
||||
return REG_REGISTRY_READONLY;
|
||||
return RegError::REGISTRY_READONLY;
|
||||
|
||||
OUString valueName("value");
|
||||
if (keyName->length)
|
||||
{
|
||||
ORegKey* pSubKey = 0;
|
||||
RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey));
|
||||
if (_ret1 != REG_NO_ERROR)
|
||||
if (_ret1 != RegError::NO_ERROR)
|
||||
return _ret1;
|
||||
|
||||
_ret1 = pSubKey->setLongListValue(valueName, pValueList, len);
|
||||
if (_ret1 != REG_NO_ERROR)
|
||||
if (_ret1 != RegError::NO_ERROR)
|
||||
{
|
||||
RegError _ret2 = pKey->closeKey(pSubKey);
|
||||
if (_ret2 != REG_NO_ERROR)
|
||||
if (_ret2 != RegError::NO_ERROR)
|
||||
return _ret2;
|
||||
else
|
||||
return _ret1;
|
||||
@@ -290,27 +290,27 @@ RegError REGISTRY_CALLTYPE setStringListValue(RegKeyHandle hKey,
|
||||
{
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->isDeleted())
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->isReadOnly())
|
||||
return REG_REGISTRY_READONLY;
|
||||
return RegError::REGISTRY_READONLY;
|
||||
|
||||
OUString valueName("value");
|
||||
if (keyName->length)
|
||||
{
|
||||
ORegKey* pSubKey = 0;
|
||||
RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey));
|
||||
if (_ret1 != REG_NO_ERROR)
|
||||
if (_ret1 != RegError::NO_ERROR)
|
||||
return _ret1;
|
||||
|
||||
_ret1 = pSubKey->setStringListValue(valueName, pValueList, len);
|
||||
if (_ret1 != REG_NO_ERROR)
|
||||
if (_ret1 != RegError::NO_ERROR)
|
||||
{
|
||||
RegError _ret2 = pKey->closeKey(pSubKey);
|
||||
if (_ret2 != REG_NO_ERROR)
|
||||
if (_ret2 != RegError::NO_ERROR)
|
||||
return _ret2;
|
||||
else
|
||||
return _ret1;
|
||||
@@ -332,27 +332,27 @@ RegError REGISTRY_CALLTYPE setUnicodeListValue(RegKeyHandle hKey,
|
||||
{
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->isDeleted())
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->isReadOnly())
|
||||
return REG_REGISTRY_READONLY;
|
||||
return RegError::REGISTRY_READONLY;
|
||||
|
||||
OUString valueName("value");
|
||||
if (keyName->length)
|
||||
{
|
||||
ORegKey* pSubKey = 0;
|
||||
RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey));
|
||||
if (_ret1 != REG_NO_ERROR)
|
||||
if (_ret1 != RegError::NO_ERROR)
|
||||
return _ret1;
|
||||
|
||||
_ret1 = pSubKey->setUnicodeListValue(valueName, pValueList, len);
|
||||
if (_ret1 != REG_NO_ERROR)
|
||||
if (_ret1 != RegError::NO_ERROR)
|
||||
{
|
||||
RegError _ret2 = pKey->closeKey(pSubKey);
|
||||
if (_ret2 != REG_NO_ERROR)
|
||||
if (_ret2 != RegError::NO_ERROR)
|
||||
return _ret2;
|
||||
else
|
||||
return _ret1;
|
||||
@@ -377,10 +377,10 @@ RegError REGISTRY_CALLTYPE getValueInfo(RegKeyHandle hKey,
|
||||
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->isDeleted())
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
RegValueType valueType;
|
||||
sal_uInt32 valueSize;
|
||||
@@ -390,13 +390,13 @@ RegError REGISTRY_CALLTYPE getValueInfo(RegKeyHandle hKey,
|
||||
{
|
||||
ORegKey* pSubKey = 0;
|
||||
RegError _ret = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey));
|
||||
if (_ret != REG_NO_ERROR)
|
||||
if (_ret != RegError::NO_ERROR)
|
||||
return _ret;
|
||||
|
||||
if (pSubKey->getValueInfo(valueName, &valueType, &valueSize) != REG_NO_ERROR)
|
||||
if (pSubKey->getValueInfo(valueName, &valueType, &valueSize) != RegError::NO_ERROR)
|
||||
{
|
||||
(void) pKey->releaseKey(pSubKey);
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
*pValueType = valueType;
|
||||
@@ -406,15 +406,15 @@ RegError REGISTRY_CALLTYPE getValueInfo(RegKeyHandle hKey,
|
||||
}
|
||||
|
||||
|
||||
if (pKey->getValueInfo(valueName, &valueType, &valueSize) != REG_NO_ERROR)
|
||||
if (pKey->getValueInfo(valueName, &valueType, &valueSize) != RegError::NO_ERROR)
|
||||
{
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
*pValueType = valueType;
|
||||
*pValueSize = valueSize;
|
||||
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -426,21 +426,21 @@ RegError REGISTRY_CALLTYPE getValue(RegKeyHandle hKey,
|
||||
{
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->isDeleted())
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
OUString valueName("value");
|
||||
if (keyName->length)
|
||||
{
|
||||
ORegKey* pSubKey = 0;
|
||||
RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey));
|
||||
if (_ret1 != REG_NO_ERROR)
|
||||
if (_ret1 != RegError::NO_ERROR)
|
||||
return _ret1;
|
||||
|
||||
_ret1 = pSubKey->getValue(valueName, pValue);
|
||||
if (_ret1 != REG_NO_ERROR)
|
||||
if (_ret1 != RegError::NO_ERROR)
|
||||
{
|
||||
(void) pKey->releaseKey(pSubKey);
|
||||
return _ret1;
|
||||
@@ -465,21 +465,21 @@ RegError REGISTRY_CALLTYPE getLongListValue(RegKeyHandle hKey,
|
||||
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->isDeleted())
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
OUString valueName("value");
|
||||
if (keyName->length)
|
||||
{
|
||||
ORegKey* pSubKey = 0;
|
||||
RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey));
|
||||
if (_ret1 != REG_NO_ERROR)
|
||||
if (_ret1 != RegError::NO_ERROR)
|
||||
return _ret1;
|
||||
|
||||
_ret1 = pSubKey->getLongListValue(valueName, pValueList, pLen);
|
||||
if (_ret1 != REG_NO_ERROR)
|
||||
if (_ret1 != RegError::NO_ERROR)
|
||||
{
|
||||
(void) pKey->releaseKey(pSubKey);
|
||||
return _ret1;
|
||||
@@ -504,21 +504,21 @@ RegError REGISTRY_CALLTYPE getStringListValue(RegKeyHandle hKey,
|
||||
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->isDeleted())
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
OUString valueName("value");
|
||||
if (keyName->length)
|
||||
{
|
||||
ORegKey* pSubKey = 0;
|
||||
RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey));
|
||||
if (_ret1 != REG_NO_ERROR)
|
||||
if (_ret1 != RegError::NO_ERROR)
|
||||
return _ret1;
|
||||
|
||||
_ret1 = pSubKey->getStringListValue(valueName, pValueList, pLen);
|
||||
if (_ret1 != REG_NO_ERROR)
|
||||
if (_ret1 != RegError::NO_ERROR)
|
||||
{
|
||||
(void) pKey->releaseKey(pSubKey);
|
||||
return _ret1;
|
||||
@@ -541,21 +541,21 @@ RegError REGISTRY_CALLTYPE getUnicodeListValue(RegKeyHandle hKey,
|
||||
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->isDeleted())
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
OUString valueName("value");
|
||||
if (keyName->length)
|
||||
{
|
||||
ORegKey* pSubKey = 0;
|
||||
RegError _ret1 = pKey->openKey(keyName, reinterpret_cast<RegKeyHandle*>(&pSubKey));
|
||||
if (_ret1 != REG_NO_ERROR)
|
||||
if (_ret1 != RegError::NO_ERROR)
|
||||
return _ret1;
|
||||
|
||||
_ret1 = pSubKey->getUnicodeListValue(valueName, pValueList, pLen);
|
||||
if (_ret1 != REG_NO_ERROR)
|
||||
if (_ret1 != RegError::NO_ERROR)
|
||||
{
|
||||
(void) pKey->releaseKey(pSubKey);
|
||||
return _ret1;
|
||||
@@ -604,11 +604,11 @@ RegError REGISTRY_CALLTYPE freeValueList(RegValueType valueType,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
pValueList = NULL;
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -621,14 +621,14 @@ RegError REGISTRY_CALLTYPE getResolvedKeyName(RegKeyHandle hKey,
|
||||
{
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->isDeleted())
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
OUString resolvedName;
|
||||
RegError _ret = pKey->getResolvedKeyName(keyName, resolvedName);
|
||||
if (_ret == REG_NO_ERROR)
|
||||
if (_ret == RegError::NO_ERROR)
|
||||
rtl_uString_assign(pResolvedName, resolvedName.pData);
|
||||
return _ret;
|
||||
}
|
||||
@@ -643,10 +643,10 @@ RegError REGISTRY_CALLTYPE getKeyNames(RegKeyHandle hKey,
|
||||
{
|
||||
ORegKey* pKey = static_cast< ORegKey* >(hKey);
|
||||
if (!pKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
if (pKey->isDeleted())
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return pKey->getKeyNames(keyName, pSubKeyNames, pnSubKeys);
|
||||
}
|
||||
@@ -664,7 +664,7 @@ RegError REGISTRY_CALLTYPE freeKeyNames(rtl_uString** pKeyNames,
|
||||
|
||||
rtl_freeMemory(pKeyNames);
|
||||
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -679,7 +679,7 @@ RegError REGISTRY_CALLTYPE reg_createKey(RegKeyHandle hKey,
|
||||
RegKeyHandle* phNewKey)
|
||||
{
|
||||
if (!hKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return createKey(hKey, keyName, phNewKey);
|
||||
}
|
||||
@@ -692,7 +692,7 @@ RegError REGISTRY_CALLTYPE reg_openKey(RegKeyHandle hKey,
|
||||
RegKeyHandle* phOpenKey)
|
||||
{
|
||||
if (!hKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return openKey(hKey, keyName, phOpenKey);
|
||||
}
|
||||
@@ -706,7 +706,7 @@ RegError REGISTRY_CALLTYPE reg_openSubKeys(RegKeyHandle hKey,
|
||||
sal_uInt32* pnSubKeys)
|
||||
{
|
||||
if (!hKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return openSubKeys(hKey, keyName, pphSubKeys, pnSubKeys);
|
||||
}
|
||||
@@ -718,7 +718,7 @@ RegError REGISTRY_CALLTYPE reg_closeSubKeys(RegKeyHandle* pphSubKeys,
|
||||
sal_uInt32 nSubKeys)
|
||||
{
|
||||
if (!pphSubKeys)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return closeSubKeys(pphSubKeys, nSubKeys);
|
||||
}
|
||||
@@ -730,7 +730,7 @@ RegError REGISTRY_CALLTYPE reg_deleteKey(RegKeyHandle hKey,
|
||||
rtl_uString* keyName)
|
||||
{
|
||||
if (!hKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return deleteKey(hKey, keyName);
|
||||
}
|
||||
@@ -741,7 +741,7 @@ RegError REGISTRY_CALLTYPE reg_deleteKey(RegKeyHandle hKey,
|
||||
RegError REGISTRY_CALLTYPE reg_closeKey(RegKeyHandle hKey)
|
||||
{
|
||||
if (!hKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return closeKey(hKey);
|
||||
}
|
||||
@@ -755,11 +755,11 @@ RegError REGISTRY_CALLTYPE reg_getKeyName(RegKeyHandle hKey, rtl_uString** pKeyN
|
||||
if (hKey)
|
||||
{
|
||||
rtl_uString_assign( pKeyName, static_cast<ORegKey*>(hKey)->getName().pData );
|
||||
return REG_NO_ERROR;
|
||||
return RegError::NO_ERROR;
|
||||
} else
|
||||
{
|
||||
rtl_uString_new( pKeyName );
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -773,7 +773,7 @@ RegError REGISTRY_CALLTYPE reg_setValue(RegKeyHandle hKey,
|
||||
sal_uInt32 valueSize)
|
||||
{
|
||||
if (!hKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return setValue(hKey, keyName, valueType, pData, valueSize);
|
||||
}
|
||||
@@ -787,7 +787,7 @@ RegError REGISTRY_CALLTYPE reg_setLongListValue(RegKeyHandle hKey,
|
||||
sal_uInt32 len)
|
||||
{
|
||||
if (!hKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return setLongListValue(hKey, keyName, pValueList, len);
|
||||
}
|
||||
@@ -801,7 +801,7 @@ RegError REGISTRY_CALLTYPE reg_setStringListValue(RegKeyHandle hKey,
|
||||
sal_uInt32 len)
|
||||
{
|
||||
if (!hKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return setStringListValue(hKey, keyName, pValueList, len);
|
||||
}
|
||||
@@ -815,7 +815,7 @@ RegError REGISTRY_CALLTYPE reg_setUnicodeListValue(RegKeyHandle hKey,
|
||||
sal_uInt32 len)
|
||||
{
|
||||
if (!hKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return setUnicodeListValue(hKey, keyName, pValueList, len);
|
||||
}
|
||||
@@ -829,7 +829,7 @@ RegError REGISTRY_CALLTYPE reg_getValueInfo(RegKeyHandle hKey,
|
||||
sal_uInt32* pValueSize)
|
||||
{
|
||||
if (!hKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return getValueInfo(hKey, keyName, pValueType, pValueSize);
|
||||
}
|
||||
@@ -842,7 +842,7 @@ RegError REGISTRY_CALLTYPE reg_getValue(RegKeyHandle hKey,
|
||||
RegValue pData)
|
||||
{
|
||||
if (!hKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return getValue(hKey, keyName, pData);
|
||||
}
|
||||
@@ -856,7 +856,7 @@ RegError REGISTRY_CALLTYPE reg_getLongListValue(RegKeyHandle hKey,
|
||||
sal_uInt32* pLen)
|
||||
{
|
||||
if (!hKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return getLongListValue(hKey, keyName, pValueList, pLen);
|
||||
}
|
||||
@@ -870,7 +870,7 @@ RegError REGISTRY_CALLTYPE reg_getStringListValue(RegKeyHandle hKey,
|
||||
sal_uInt32* pLen)
|
||||
{
|
||||
if (!hKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return getStringListValue(hKey, keyName, pValueList, pLen);
|
||||
}
|
||||
@@ -884,7 +884,7 @@ RegError REGISTRY_CALLTYPE reg_getUnicodeListValue(RegKeyHandle hKey,
|
||||
sal_uInt32* pLen)
|
||||
{
|
||||
if (!hKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return getUnicodeListValue(hKey, keyName, pValueList, pLen);
|
||||
}
|
||||
@@ -899,7 +899,7 @@ RegError REGISTRY_CALLTYPE reg_freeValueList(RegValueType valueType,
|
||||
if (pValueList)
|
||||
return freeValueList(valueType, pValueList, len);
|
||||
else
|
||||
return REG_INVALID_VALUE;
|
||||
return RegError::INVALID_VALUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -911,7 +911,7 @@ RegError REGISTRY_CALLTYPE reg_getResolvedKeyName(RegKeyHandle hKey,
|
||||
rtl_uString** pResolvedName)
|
||||
{
|
||||
if (!hKey)
|
||||
return REG_INVALID_KEY;
|
||||
return RegError::INVALID_KEY;
|
||||
|
||||
return getResolvedKeyName(hKey, keyName, firstLinkOnly, pResolvedName);
|
||||
}
|
||||
|
@@ -1647,7 +1647,7 @@ static bool hasPublishedChildren(Options_Impl const & options, RegistryKey & key
|
||||
{
|
||||
keyName = keyName.copy(keyName.lastIndexOf('/') + 1);
|
||||
RegistryKey subKey;
|
||||
if (!key.openKey(keyName, subKey))
|
||||
if (key.openKey(keyName, subKey) == RegError::NO_ERROR)
|
||||
{
|
||||
if (options.forceOutput())
|
||||
{
|
||||
@@ -1663,7 +1663,7 @@ static bool hasPublishedChildren(Options_Impl const & options, RegistryKey & key
|
||||
{
|
||||
RegValueType type;
|
||||
sal_uInt32 size;
|
||||
if (subKey.getValueInfo(OUString(), &type, &size) != REG_NO_ERROR)
|
||||
if (subKey.getValueInfo(OUString(), &type, &size) != RegError::NO_ERROR)
|
||||
{
|
||||
if (options.forceOutput())
|
||||
{
|
||||
@@ -1679,7 +1679,7 @@ static bool hasPublishedChildren(Options_Impl const & options, RegistryKey & key
|
||||
{
|
||||
bool published = false;
|
||||
std::vector< sal_uInt8 > value(size);
|
||||
if (subKey.getValue(OUString(), &value[0]) != REG_NO_ERROR)
|
||||
if (subKey.getValue(OUString(), &value[0]) != RegError::NO_ERROR)
|
||||
{
|
||||
if (options.forceOutput())
|
||||
{
|
||||
@@ -1747,7 +1747,7 @@ static sal_uInt32 checkDifferences(
|
||||
{
|
||||
keyName = keyName.copy(keyName.lastIndexOf('/') + 1);
|
||||
RegistryKey subKey;
|
||||
if (key.openKey(keyName, subKey))
|
||||
if (key.openKey(keyName, subKey) != RegError::NO_ERROR)
|
||||
{
|
||||
if (options.forceOutput())
|
||||
{
|
||||
@@ -1764,7 +1764,7 @@ static sal_uInt32 checkDifferences(
|
||||
{
|
||||
RegValueType type;
|
||||
sal_uInt32 size;
|
||||
if (subKey.getValueInfo(OUString(), &type, &size) != REG_NO_ERROR)
|
||||
if (subKey.getValueInfo(OUString(), &type, &size) != RegError::NO_ERROR)
|
||||
{
|
||||
if (options.forceOutput())
|
||||
{
|
||||
@@ -1780,7 +1780,7 @@ static sal_uInt32 checkDifferences(
|
||||
else if (type == RegValueType::BINARY)
|
||||
{
|
||||
std::vector< sal_uInt8 > value(size);
|
||||
if (subKey.getValue(OUString(), &value[0]) != REG_NO_ERROR)
|
||||
if (subKey.getValue(OUString(), &value[0]) != RegError::NO_ERROR)
|
||||
{
|
||||
if (options.forceOutput())
|
||||
{
|
||||
@@ -1876,13 +1876,13 @@ static sal_uInt32 compareKeys(
|
||||
OUString tmpName;
|
||||
RegError e1 = key1.getValueInfo(tmpName, &valueType1, &size1);
|
||||
RegError e2 = key2.getValueInfo(tmpName, &valueType2, &size2);
|
||||
if ( (e1 == e2) && (e1 != REG_VALUE_NOT_EXISTS) && (e1 != REG_INVALID_VALUE) )
|
||||
if ( (e1 == e2) && (e1 != RegError::VALUE_NOT_EXISTS) && (e1 != RegError::INVALID_VALUE) )
|
||||
{
|
||||
nError += checkValueDifference(options, key1, valueType1, size1, key2, valueType2, size2);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( (e1 != REG_INVALID_VALUE) || (e2 != REG_INVALID_VALUE) )
|
||||
if ( (e1 != RegError::INVALID_VALUE) || (e2 != RegError::INVALID_VALUE) )
|
||||
{
|
||||
if ( options.forceOutput() )
|
||||
{
|
||||
@@ -1917,7 +1917,7 @@ static sal_uInt32 compareKeys(
|
||||
keyName = keyName.copy( nPos != -1 ? nPos+1 : 0 );
|
||||
|
||||
RegistryKey subKey1;
|
||||
if ( key1.openKey(keyName, subKey1) )
|
||||
if ( key1.openKey(keyName, subKey1) != RegError::NO_ERROR )
|
||||
{
|
||||
if ( options.forceOutput() )
|
||||
{
|
||||
@@ -1928,7 +1928,7 @@ static sal_uInt32 compareKeys(
|
||||
}
|
||||
|
||||
RegistryKey subKey2;
|
||||
if ( key2.openKey(keyName, subKey2) )
|
||||
if ( key2.openKey(keyName, subKey2) != RegError::NO_ERROR )
|
||||
{
|
||||
if ( options.forceOutput() )
|
||||
{
|
||||
@@ -1975,13 +1975,13 @@ int _cdecl main( int argc, char * argv[] )
|
||||
OUString regName2( convertToFileUrl(options.getRegName2().c_str(), options.getRegName2().size()) );
|
||||
|
||||
Registry reg1, reg2;
|
||||
if ( reg1.open(regName1, RegAccessMode::READONLY) )
|
||||
if ( reg1.open(regName1, RegAccessMode::READONLY) != RegError::NO_ERROR )
|
||||
{
|
||||
fprintf(stdout, "%s: open registry \"%s\" failed\n",
|
||||
options.getProgramName().c_str(), options.getRegName1().c_str());
|
||||
return 2;
|
||||
}
|
||||
if ( reg2.open(regName2, RegAccessMode::READONLY) )
|
||||
if ( reg2.open(regName2, RegAccessMode::READONLY) != RegError::NO_ERROR )
|
||||
{
|
||||
fprintf(stdout, "%s: open registry \"%s\" failed\n",
|
||||
options.getProgramName().c_str(), options.getRegName2().c_str());
|
||||
@@ -1989,13 +1989,13 @@ int _cdecl main( int argc, char * argv[] )
|
||||
}
|
||||
|
||||
RegistryKey key1, key2;
|
||||
if ( reg1.openRootKey(key1) )
|
||||
if ( reg1.openRootKey(key1) != RegError::NO_ERROR )
|
||||
{
|
||||
fprintf(stdout, "%s: open root key of registry \"%s\" failed\n",
|
||||
options.getProgramName().c_str(), options.getRegName1().c_str());
|
||||
return 4;
|
||||
}
|
||||
if ( reg2.openRootKey(key2) )
|
||||
if ( reg2.openRootKey(key2) != RegError::NO_ERROR )
|
||||
{
|
||||
fprintf(stdout, "%s: open root key of registry \"%s\" failed\n",
|
||||
options.getProgramName().c_str(), options.getRegName2().c_str());
|
||||
@@ -2011,13 +2011,13 @@ int _cdecl main( int argc, char * argv[] )
|
||||
return 6;
|
||||
}
|
||||
RegistryKey sk1, sk2;
|
||||
if ( key1.openKey(options.getStartKey(), sk1) )
|
||||
if ( key1.openKey(options.getStartKey(), sk1) != RegError::NO_ERROR )
|
||||
{
|
||||
fprintf(stdout, "%s: open start key of registry \"%s\" failed\n",
|
||||
options.getProgramName().c_str(), options.getRegName1().c_str());
|
||||
return 7;
|
||||
}
|
||||
if ( key2.openKey(options.getStartKey(), sk2) )
|
||||
if ( key2.openKey(options.getStartKey(), sk2) != RegError::NO_ERROR )
|
||||
{
|
||||
fprintf(stdout, "%s: open start key of registry \"%s\" failed\n",
|
||||
options.getProgramName().c_str(), options.getRegName2().c_str());
|
||||
@@ -2047,13 +2047,13 @@ int _cdecl main( int argc, char * argv[] )
|
||||
|
||||
key1.releaseKey();
|
||||
key2.releaseKey();
|
||||
if ( reg1.close() )
|
||||
if ( reg1.close() != RegError::NO_ERROR )
|
||||
{
|
||||
fprintf(stdout, "%s: closing registry \"%s\" failed\n",
|
||||
options.getProgramName().c_str(), options.getRegName1().c_str());
|
||||
return 9;
|
||||
}
|
||||
if ( reg2.close() )
|
||||
if ( reg2.close() != RegError::NO_ERROR )
|
||||
{
|
||||
fprintf(stdout, "%s: closing registry \"%s\" failed\n",
|
||||
options.getProgramName().c_str(), options.getRegName2().c_str());
|
||||
|
@@ -109,9 +109,9 @@ int __cdecl main( int argc, char * argv[] )
|
||||
|
||||
Registry reg;
|
||||
OUString regName( convertToFileUrl(args[0].c_str(), args[0].size()) );
|
||||
if (reg.open(regName, RegAccessMode::READWRITE) != REG_NO_ERROR)
|
||||
if (reg.open(regName, RegAccessMode::READWRITE) != RegError::NO_ERROR)
|
||||
{
|
||||
if (reg.create(regName) != REG_NO_ERROR)
|
||||
if (reg.create(regName) != RegError::NO_ERROR)
|
||||
{
|
||||
if (options.isVerbose())
|
||||
fprintf(stderr, "open registry \"%s\" failed\n", args[0].c_str());
|
||||
@@ -120,7 +120,7 @@ int __cdecl main( int argc, char * argv[] )
|
||||
}
|
||||
|
||||
RegistryKey rootKey;
|
||||
if (reg.openRootKey(rootKey) != REG_NO_ERROR)
|
||||
if (reg.openRootKey(rootKey) != RegError::NO_ERROR)
|
||||
{
|
||||
if (options.isVerbose())
|
||||
fprintf(stderr, "open root key of registry \"%s\" failed\n", args[0].c_str());
|
||||
@@ -132,9 +132,9 @@ int __cdecl main( int argc, char * argv[] )
|
||||
{
|
||||
OUString targetRegName( convertToFileUrl(args[i].c_str(), args[i].size()) );
|
||||
RegError _ret = reg.mergeKey(rootKey, mergeKeyName, targetRegName, false, options.isVerbose());
|
||||
if (_ret != REG_NO_ERROR)
|
||||
if (_ret != RegError::NO_ERROR)
|
||||
{
|
||||
if (_ret == REG_MERGE_CONFLICT)
|
||||
if (_ret == RegError::MERGE_CONFLICT)
|
||||
{
|
||||
if (options.isVerbose())
|
||||
fprintf(stderr, "merging registry \"%s\" under key \"%s\" in registry \"%s\".\n",
|
||||
@@ -157,7 +157,7 @@ int __cdecl main( int argc, char * argv[] )
|
||||
}
|
||||
|
||||
rootKey.releaseKey();
|
||||
if (reg.close() != REG_NO_ERROR)
|
||||
if (reg.close() != RegError::NO_ERROR)
|
||||
{
|
||||
if (options.isVerbose())
|
||||
fprintf(stderr, "closing registry \"%s\" failed\n", args[0].c_str());
|
||||
|
@@ -44,25 +44,25 @@ int __cdecl main( int argc, char * argv[] )
|
||||
}
|
||||
|
||||
OUString regName( convertToFileUrl(argv[1], strlen(argv[1])) );
|
||||
if (reg_openRegistry(regName.pData, &hReg, RegAccessMode::READONLY))
|
||||
if (reg_openRegistry(regName.pData, &hReg, RegAccessMode::READONLY) != RegError::NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "open registry \"%s\" failed\n", argv[1]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!reg_openRootKey(hReg, &hRootKey))
|
||||
if (reg_openRootKey(hReg, &hRootKey) == RegError::NO_ERROR)
|
||||
{
|
||||
if (argc == 3)
|
||||
{
|
||||
OUString keyName( OUString::createFromAscii(argv[2]) );
|
||||
if (!reg_openKey(hRootKey, keyName.pData, &hKey))
|
||||
if (reg_openKey(hRootKey, keyName.pData, &hKey) == RegError::NO_ERROR)
|
||||
{
|
||||
if (reg_dumpRegistry(hKey))
|
||||
if (reg_dumpRegistry(hKey) != RegError::NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "dumping registry \"%s\" failed\n", argv[1]);
|
||||
}
|
||||
|
||||
if (reg_closeKey(hKey))
|
||||
if (reg_closeKey(hKey) != RegError::NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "closing key \"%s\" of registry \"%s\" failed\n",
|
||||
argv[2], argv[1]);
|
||||
@@ -76,13 +76,13 @@ int __cdecl main( int argc, char * argv[] )
|
||||
}
|
||||
else
|
||||
{
|
||||
if (reg_dumpRegistry(hRootKey))
|
||||
if (reg_dumpRegistry(hRootKey) != RegError::NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "dumping registry \"%s\" failed\n", argv[1]);
|
||||
}
|
||||
}
|
||||
|
||||
if (reg_closeKey(hRootKey))
|
||||
if (reg_closeKey(hRootKey) != RegError::NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "closing root key of registry \"%s\" failed\n", argv[1]);
|
||||
}
|
||||
@@ -92,7 +92,7 @@ int __cdecl main( int argc, char * argv[] )
|
||||
fprintf(stderr, "open root key of registry \"%s\" failed\n", argv[1]);
|
||||
}
|
||||
|
||||
if (reg_closeRegistry(hReg))
|
||||
if (reg_closeRegistry(hReg) != RegError::NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "closing registry \"%s\" failed\n", argv[1]);
|
||||
exit(1);
|
||||
|
@@ -278,16 +278,16 @@ css::registry::RegistryValueType Key::getValueType()
|
||||
sal_uInt32 size;
|
||||
RegError err = key_.getValueInfo(OUString(), &type, &size);
|
||||
switch (err) {
|
||||
case REG_NO_ERROR:
|
||||
case RegError::NO_ERROR:
|
||||
break;
|
||||
case REG_INVALID_VALUE:
|
||||
case RegError::INVALID_VALUE:
|
||||
type = RegValueType::NOT_DEFINED;
|
||||
break;
|
||||
default:
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key getValueType:"
|
||||
" underlying RegistryKey::getValueInfo() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
switch (type) {
|
||||
@@ -321,18 +321,18 @@ sal_Int32 Key::getLongValue() throw (
|
||||
sal_Int32 value;
|
||||
RegError err = key_.getValue(OUString(), &value);
|
||||
switch (err) {
|
||||
case REG_NO_ERROR:
|
||||
case RegError::NO_ERROR:
|
||||
break;
|
||||
case REG_INVALID_VALUE:
|
||||
case RegError::INVALID_VALUE:
|
||||
throw css::registry::InvalidValueException(
|
||||
OUString("com.sun.star.registry.SimpleRegistry key getLongValue:"
|
||||
" underlying RegistryKey::getValue() = REG_INVALID_VALUE"),
|
||||
" underlying RegistryKey::getValue() = RegError::INVALID_VALUE"),
|
||||
static_cast< OWeakObject * >(this));
|
||||
default:
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key getLongValue:"
|
||||
" underlying RegistryKey::getValue() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
return value;
|
||||
@@ -344,11 +344,11 @@ void Key::setLongValue(sal_Int32 value)
|
||||
osl::MutexGuard guard(registry_->mutex_);
|
||||
RegError err = key_.setValue(
|
||||
OUString(), RegValueType::LONG, &value, sizeof (sal_Int32));
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key setLongValue:"
|
||||
" underlying RegistryKey::setValue() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
}
|
||||
@@ -361,21 +361,21 @@ css::uno::Sequence< sal_Int32 > Key::getLongListValue() throw (
|
||||
RegistryValueList< sal_Int32 > list;
|
||||
RegError err = key_.getLongListValue(OUString(), list);
|
||||
switch (err) {
|
||||
case REG_NO_ERROR:
|
||||
case RegError::NO_ERROR:
|
||||
break;
|
||||
case REG_VALUE_NOT_EXISTS:
|
||||
case RegError::VALUE_NOT_EXISTS:
|
||||
return css::uno::Sequence< sal_Int32 >();
|
||||
case REG_INVALID_VALUE:
|
||||
case RegError::INVALID_VALUE:
|
||||
throw css::registry::InvalidValueException(
|
||||
OUString("com.sun.star.registry.SimpleRegistry key getLongListValue:"
|
||||
" underlying RegistryKey::getLongListValue() ="
|
||||
" REG_INVALID_VALUE"),
|
||||
" RegError::INVALID_VALUE"),
|
||||
static_cast< OWeakObject * >(this));
|
||||
default:
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key getLongListValue:"
|
||||
" underlying RegistryKey::getLongListValue() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
sal_uInt32 n = list.getLength();
|
||||
@@ -402,11 +402,11 @@ void Key::setLongListValue(css::uno::Sequence< sal_Int32 > const & seqValue)
|
||||
}
|
||||
RegError err = key_.setLongListValue(
|
||||
OUString(), list.data(), static_cast< sal_uInt32 >(list.size()));
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key setLongListValue:"
|
||||
" underlying RegistryKey::setLongListValue() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
}
|
||||
@@ -419,11 +419,11 @@ OUString Key::getAsciiValue() throw (
|
||||
RegValueType type;
|
||||
sal_uInt32 size;
|
||||
RegError err = key_.getValueInfo(OUString(), &type, &size);
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key getAsciiValue:"
|
||||
" underlying RegistryKey::getValueInfo() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
if (type != RegValueType::STRING) {
|
||||
@@ -449,11 +449,11 @@ OUString Key::getAsciiValue() throw (
|
||||
}
|
||||
std::vector< char > list(size);
|
||||
err = key_.getValue(OUString(), &list[0]);
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key getAsciiValue:"
|
||||
" underlying RegistryKey::getValue() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
if (list[size - 1] != '\0') {
|
||||
@@ -498,11 +498,11 @@ void Key::setAsciiValue(OUString const & value)
|
||||
OUString(), RegValueType::STRING,
|
||||
const_cast< char * >(utf8.getStr()), utf8.getLength() + 1);
|
||||
// +1 for terminating null (error in underlying registry.cxx)
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key setAsciiValue:"
|
||||
" underlying RegistryKey::setValue() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
}
|
||||
@@ -515,22 +515,22 @@ css::uno::Sequence< OUString > Key::getAsciiListValue() throw (
|
||||
RegistryValueList< char * > list;
|
||||
RegError err = key_.getStringListValue(OUString(), list);
|
||||
switch (err) {
|
||||
case REG_NO_ERROR:
|
||||
case RegError::NO_ERROR:
|
||||
break;
|
||||
case REG_VALUE_NOT_EXISTS:
|
||||
case RegError::VALUE_NOT_EXISTS:
|
||||
return css::uno::Sequence< OUString >();
|
||||
case REG_INVALID_VALUE:
|
||||
case RegError::INVALID_VALUE:
|
||||
throw css::registry::InvalidValueException(
|
||||
OUString("com.sun.star.registry.SimpleRegistry key"
|
||||
" getAsciiListValue: underlying"
|
||||
" RegistryKey::getStringListValue() = REG_INVALID_VALUE"),
|
||||
" RegistryKey::getStringListValue() = RegError::INVALID_VALUE"),
|
||||
static_cast< OWeakObject * >(this));
|
||||
default:
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key"
|
||||
" getAsciiListValue: underlying"
|
||||
" RegistryKey::getStringListValue() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
sal_uInt32 n = list.getLength();
|
||||
@@ -590,12 +590,12 @@ void Key::setAsciiListValue(
|
||||
}
|
||||
RegError err = key_.setStringListValue(
|
||||
OUString(), list2.data(), static_cast< sal_uInt32 >(list2.size()));
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key"
|
||||
" setAsciiListValue: underlying"
|
||||
" RegistryKey::setStringListValue() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
}
|
||||
@@ -608,11 +608,11 @@ OUString Key::getStringValue() throw (
|
||||
RegValueType type;
|
||||
sal_uInt32 size;
|
||||
RegError err = key_.getValueInfo(OUString(), &type, &size);
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key getStringValue:"
|
||||
" underlying RegistryKey::getValueInfo() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
if (type != RegValueType::UNICODE) {
|
||||
@@ -639,11 +639,11 @@ OUString Key::getStringValue() throw (
|
||||
}
|
||||
std::vector< sal_Unicode > list(size);
|
||||
err = key_.getValue(OUString(), &list[0]);
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key getStringValue:"
|
||||
" underlying RegistryKey::getValue() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
if (list[size/2 - 1] != 0) {
|
||||
@@ -665,11 +665,11 @@ void Key::setStringValue(OUString const & value)
|
||||
const_cast< sal_Unicode * >(value.getStr()),
|
||||
(value.getLength() + 1) * sizeof (sal_Unicode));
|
||||
// +1 for terminating null (error in underlying registry.cxx)
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key setStringValue:"
|
||||
" underlying RegistryKey::setValue() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
}
|
||||
@@ -682,22 +682,22 @@ css::uno::Sequence< OUString > Key::getStringListValue() throw (
|
||||
RegistryValueList< sal_Unicode * > list;
|
||||
RegError err = key_.getUnicodeListValue(OUString(), list);
|
||||
switch (err) {
|
||||
case REG_NO_ERROR:
|
||||
case RegError::NO_ERROR:
|
||||
break;
|
||||
case REG_VALUE_NOT_EXISTS:
|
||||
case RegError::VALUE_NOT_EXISTS:
|
||||
return css::uno::Sequence< OUString >();
|
||||
case REG_INVALID_VALUE:
|
||||
case RegError::INVALID_VALUE:
|
||||
throw css::registry::InvalidValueException(
|
||||
OUString("com.sun.star.registry.SimpleRegistry key"
|
||||
" getStringListValue: underlying"
|
||||
" RegistryKey::getUnicodeListValue() = REG_INVALID_VALUE"),
|
||||
" RegistryKey::getUnicodeListValue() = RegError::INVALID_VALUE"),
|
||||
static_cast< OWeakObject * >(this));
|
||||
default:
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key"
|
||||
" getStringListValue: underlying"
|
||||
" RegistryKey::getUnicodeListValue() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
sal_uInt32 n = list.getLength();
|
||||
@@ -726,12 +726,12 @@ void Key::setStringListValue(
|
||||
}
|
||||
RegError err = key_.setUnicodeListValue(
|
||||
OUString(), list.data(), static_cast< sal_uInt32 >(list.size()));
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key"
|
||||
" setStringListValue: underlying"
|
||||
" RegistryKey::setUnicodeListValue() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
}
|
||||
@@ -745,11 +745,11 @@ css::uno::Sequence< sal_Int8 > Key::getBinaryValue()
|
||||
RegValueType type;
|
||||
sal_uInt32 size;
|
||||
RegError err = key_.getValueInfo(OUString(), &type, &size);
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key getBinaryValue:"
|
||||
" underlying RegistryKey::getValueInfo() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
if (type != RegValueType::BINARY) {
|
||||
@@ -767,11 +767,11 @@ css::uno::Sequence< sal_Int8 > Key::getBinaryValue()
|
||||
}
|
||||
css::uno::Sequence< sal_Int8 > value(static_cast< sal_Int32 >(size));
|
||||
err = key_.getValue(OUString(), value.getArray());
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key getBinaryValue:"
|
||||
" underlying RegistryKey::getValue() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
return value;
|
||||
@@ -785,11 +785,11 @@ void Key::setBinaryValue(css::uno::Sequence< sal_Int8 > const & value)
|
||||
OUString(), RegValueType::BINARY,
|
||||
const_cast< sal_Int8 * >(value.getConstArray()),
|
||||
static_cast< sal_uInt32 >(value.getLength()));
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key setBinaryValue:"
|
||||
" underlying RegistryKey::setValue() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
}
|
||||
@@ -802,15 +802,15 @@ css::uno::Reference< css::registry::XRegistryKey > Key::openKey(
|
||||
RegistryKey key;
|
||||
RegError err = key_.openKey(aKeyName, key);
|
||||
switch (err) {
|
||||
case REG_NO_ERROR:
|
||||
case RegError::NO_ERROR:
|
||||
return new Key(registry_, key);
|
||||
case REG_KEY_NOT_EXISTS:
|
||||
case RegError::KEY_NOT_EXISTS:
|
||||
return css::uno::Reference< css::registry::XRegistryKey >();
|
||||
default:
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key openKey:"
|
||||
" underlying RegistryKey::openKey() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
}
|
||||
@@ -823,15 +823,15 @@ css::uno::Reference< css::registry::XRegistryKey > Key::createKey(
|
||||
RegistryKey key;
|
||||
RegError err = key_.createKey(aKeyName, key);
|
||||
switch (err) {
|
||||
case REG_NO_ERROR:
|
||||
case RegError::NO_ERROR:
|
||||
return new Key(registry_, key);
|
||||
case REG_INVALID_KEYNAME:
|
||||
case RegError::INVALID_KEYNAME:
|
||||
return css::uno::Reference< css::registry::XRegistryKey >();
|
||||
default:
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key createKey:"
|
||||
" underlying RegistryKey::createKey() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
}
|
||||
@@ -841,11 +841,11 @@ void Key::closeKey()
|
||||
{
|
||||
osl::MutexGuard guard(registry_->mutex_);
|
||||
RegError err = key_.closeKey();
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key closeKey:"
|
||||
" underlying RegistryKey::closeKey() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
}
|
||||
@@ -855,11 +855,11 @@ void Key::deleteKey(OUString const & rKeyName)
|
||||
{
|
||||
osl::MutexGuard guard(registry_->mutex_);
|
||||
RegError err = key_.deleteKey(rKeyName);
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key deleteKey:"
|
||||
" underlying RegistryKey::deleteKey() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
}
|
||||
@@ -871,11 +871,11 @@ Key::openKeys()
|
||||
osl::MutexGuard guard(registry_->mutex_);
|
||||
RegistryKeyArray list;
|
||||
RegError err = key_.openSubKeys(OUString(), list);
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key openKeys:"
|
||||
" underlying RegistryKey::openSubKeys() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
sal_uInt32 n = list.getLength();
|
||||
@@ -900,11 +900,11 @@ css::uno::Sequence< OUString > Key::getKeyNames()
|
||||
osl::MutexGuard guard(registry_->mutex_);
|
||||
RegistryKeyNames list;
|
||||
RegError err = key_.getKeyNames(OUString(), list);
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key getKeyNames:"
|
||||
" underlying RegistryKey::getKeyNames() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
sal_uInt32 n = list.getLength();
|
||||
@@ -928,14 +928,14 @@ sal_Bool Key::createLink(
|
||||
osl::MutexGuard guard(registry_->mutex_);
|
||||
RegError err = key_.createLink(aLinkName, aLinkTarget);
|
||||
switch (err) {
|
||||
case REG_NO_ERROR:
|
||||
case RegError::NO_ERROR:
|
||||
return true;
|
||||
case REG_INVALID_KEY:
|
||||
case REG_DETECT_RECURSION:
|
||||
case RegError::INVALID_KEY:
|
||||
case RegError::DETECT_RECURSION:
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key createLink:"
|
||||
" underlying RegistryKey::createLink() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
default:
|
||||
return false;
|
||||
@@ -947,11 +947,11 @@ void Key::deleteLink(OUString const & rLinkName)
|
||||
{
|
||||
osl::MutexGuard guard(registry_->mutex_);
|
||||
RegError err = key_.deleteLink(rLinkName);
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key deleteLink:"
|
||||
" underlying RegistryKey::deleteLink() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
}
|
||||
@@ -962,11 +962,11 @@ OUString Key::getLinkTarget(OUString const & rLinkName)
|
||||
osl::MutexGuard guard(registry_->mutex_);
|
||||
OUString target;
|
||||
RegError err = key_.getLinkTarget(rLinkName, target);
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key getLinkTarget:"
|
||||
" underlying RegistryKey::getLinkTarget() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
return target;
|
||||
@@ -978,11 +978,11 @@ OUString Key::getResolvedName(OUString const & aKeyName)
|
||||
osl::MutexGuard guard(registry_->mutex_);
|
||||
OUString resolved;
|
||||
RegError err = key_.getResolvedKeyName(aKeyName, true, resolved);
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry key getResolvedName:"
|
||||
" underlying RegistryKey::getResolvedName() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
return resolved;
|
||||
@@ -999,17 +999,17 @@ void SimpleRegistry::open(
|
||||
{
|
||||
osl::MutexGuard guard(mutex_);
|
||||
RegError err = (rURL.isEmpty() && bCreate)
|
||||
? REG_REGISTRY_NOT_EXISTS
|
||||
? RegError::REGISTRY_NOT_EXISTS
|
||||
: registry_.open(rURL, bReadOnly ? RegAccessMode::READONLY : RegAccessMode::READWRITE);
|
||||
if (err == REG_REGISTRY_NOT_EXISTS && bCreate) {
|
||||
if (err == RegError::REGISTRY_NOT_EXISTS && bCreate) {
|
||||
err = registry_.create(rURL);
|
||||
}
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
("com.sun.star.registry.SimpleRegistry.open(" +
|
||||
rURL +
|
||||
"): underlying Registry::open/create() = " +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
}
|
||||
@@ -1024,11 +1024,11 @@ void SimpleRegistry::close()
|
||||
{
|
||||
osl::MutexGuard guard(mutex_);
|
||||
RegError err = registry_.close();
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry.close:"
|
||||
" underlying Registry::close() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
}
|
||||
@@ -1038,11 +1038,11 @@ void SimpleRegistry::destroy()
|
||||
{
|
||||
osl::MutexGuard guard(mutex_);
|
||||
RegError err = registry_.destroy(OUString());
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry.destroy:"
|
||||
" underlying Registry::destroy() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
}
|
||||
@@ -1053,11 +1053,11 @@ css::uno::Reference< css::registry::XRegistryKey > SimpleRegistry::getRootKey()
|
||||
osl::MutexGuard guard(mutex_);
|
||||
RegistryKey root;
|
||||
RegError err = registry_.openRootKey(root);
|
||||
if (err != REG_NO_ERROR) {
|
||||
if (err != RegError::NO_ERROR) {
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry.getRootKey:"
|
||||
" underlying Registry::getRootKey() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
return new Key(this, root);
|
||||
@@ -1079,23 +1079,23 @@ void SimpleRegistry::mergeKey(
|
||||
osl::MutexGuard guard(mutex_);
|
||||
RegistryKey root;
|
||||
RegError err = registry_.openRootKey(root);
|
||||
if (err == REG_NO_ERROR) {
|
||||
if (err == RegError::NO_ERROR) {
|
||||
err = registry_.mergeKey(root, aKeyName, aUrl, false, false);
|
||||
}
|
||||
switch (err) {
|
||||
case REG_NO_ERROR:
|
||||
case REG_MERGE_CONFLICT:
|
||||
case RegError::NO_ERROR:
|
||||
case RegError::MERGE_CONFLICT:
|
||||
break;
|
||||
case REG_MERGE_ERROR:
|
||||
case RegError::MERGE_ERROR:
|
||||
throw css::registry::MergeConflictException(
|
||||
OUString("com.sun.star.registry.SimpleRegistry.mergeKey:"
|
||||
" underlying Registry::mergeKey() = REG_MERGE_ERROR"),
|
||||
" underlying Registry::mergeKey() = RegError::MERGE_ERROR"),
|
||||
static_cast< cppu::OWeakObject * >(this));
|
||||
default:
|
||||
throw css::registry::InvalidRegistryException(
|
||||
(("com.sun.star.registry.SimpleRegistry.mergeKey:"
|
||||
" underlying Registry::getRootKey/mergeKey() = ") +
|
||||
OUString::number(err)),
|
||||
OUString::number(static_cast<int>(err))),
|
||||
static_cast< OWeakObject * >(this));
|
||||
}
|
||||
}
|
||||
|
@@ -103,11 +103,11 @@ Cursor::Cursor(
|
||||
prefix_ += "/";
|
||||
}
|
||||
RegError e = key_.getKeyNames("", names_);
|
||||
if (e != REG_NO_ERROR) {
|
||||
if (e != RegError::NO_ERROR) {
|
||||
throw FileFormatException(
|
||||
key_.getRegistryName(),
|
||||
("legacy format: cannot get sub-key names of " + key_.getName()
|
||||
+ ": " + OUString::number(e)));
|
||||
+ ": " + OUString::number(static_cast<int>(e))));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -150,11 +150,11 @@ private:
|
||||
std::vector< OUString > Module::getMemberNames() const {
|
||||
RegistryKeyNames names;
|
||||
RegError e = key_.getKeyNames("", names);
|
||||
if (e != REG_NO_ERROR) {
|
||||
if (e != RegError::NO_ERROR) {
|
||||
throw FileFormatException(
|
||||
key_.getRegistryName(),
|
||||
("legacy format: cannot get sub-key names of " + key_.getName()
|
||||
+ ": " + OUString::number(e)));
|
||||
+ ": " + OUString::number(static_cast<int>(e))));
|
||||
}
|
||||
std::vector< OUString > ns;
|
||||
for (sal_uInt32 i = 0; i != names.getLength(); ++i) {
|
||||
@@ -168,11 +168,11 @@ typereg::Reader getReader(RegistryKey & key, std::vector< char > * buffer) {
|
||||
RegValueType type;
|
||||
sal_uInt32 size;
|
||||
RegError e = key.getValueInfo("", &type, &size);
|
||||
if (e != REG_NO_ERROR) {
|
||||
if (e != RegError::NO_ERROR) {
|
||||
throw FileFormatException(
|
||||
key.getRegistryName(),
|
||||
("legacy format: cannot get value info about key " + key.getName()
|
||||
+ ": " + OUString::number(e)));
|
||||
+ ": " + OUString::number(static_cast<int>(e))));
|
||||
}
|
||||
if (type != RegValueType::BINARY) {
|
||||
throw FileFormatException(
|
||||
@@ -190,11 +190,11 @@ typereg::Reader getReader(RegistryKey & key, std::vector< char > * buffer) {
|
||||
}
|
||||
buffer->resize(static_cast< std::vector< char >::size_type >(size));
|
||||
e = key.getValue("", &(*buffer)[0]);
|
||||
if (e != REG_NO_ERROR) {
|
||||
if (e != RegError::NO_ERROR) {
|
||||
throw FileFormatException(
|
||||
key.getRegistryName(),
|
||||
("legacy format: cannot get binary value of key " + key.getName()
|
||||
+ ": " + OUString::number(e)));
|
||||
+ ": " + OUString::number(static_cast<int>(e))));
|
||||
}
|
||||
typereg::Reader reader(&(*buffer)[0], size, false, TYPEREG_VERSION_1);
|
||||
if (!reader.isValid()) {
|
||||
@@ -213,9 +213,9 @@ rtl::Reference< Entity > readEntity(
|
||||
RegistryKey sub;
|
||||
RegError e = key.openKey(path, sub);
|
||||
switch (e) {
|
||||
case REG_NO_ERROR:
|
||||
case RegError::NO_ERROR:
|
||||
break;
|
||||
case REG_KEY_NOT_EXISTS:
|
||||
case RegError::KEY_NOT_EXISTS:
|
||||
if (probe) {
|
||||
return rtl::Reference< Entity >();
|
||||
}
|
||||
@@ -224,7 +224,7 @@ rtl::Reference< Entity > readEntity(
|
||||
throw FileFormatException(
|
||||
key.getRegistryName(),
|
||||
("legacy format: cannot open sub-key " + path + " of "
|
||||
+ key.getName() + ": " + OUString::number(e)));
|
||||
+ key.getName() + ": " + OUString::number(static_cast<int>(e))));
|
||||
}
|
||||
std::vector< char > buf;
|
||||
typereg::Reader reader(getReader(sub, &buf));
|
||||
@@ -725,9 +725,9 @@ rtl::Reference< Entity > readEntity(
|
||||
RegistryKey key2;
|
||||
e = ucr.openKey(basePath, key2);
|
||||
switch (e) {
|
||||
case REG_NO_ERROR:
|
||||
case RegError::NO_ERROR:
|
||||
break;
|
||||
case REG_KEY_NOT_EXISTS:
|
||||
case RegError::KEY_NOT_EXISTS:
|
||||
throw FileFormatException(
|
||||
key.getRegistryName(),
|
||||
("legacy format: unknown super-type " + basePath
|
||||
@@ -736,7 +736,7 @@ rtl::Reference< Entity > readEntity(
|
||||
throw FileFormatException(
|
||||
key.getRegistryName(),
|
||||
("legacy format: cannot open ucr sub-key " + basePath
|
||||
+ ": " + OUString::number(e)));
|
||||
+ ": " + OUString::number(static_cast<int>(e))));
|
||||
}
|
||||
std::vector< char > buf2;
|
||||
typereg::Reader reader2(getReader(key2, &buf2));
|
||||
@@ -798,28 +798,28 @@ LegacyProvider::LegacyProvider(Manager & manager, OUString const & uri):
|
||||
Registry reg;
|
||||
RegError e = reg.open(uri, RegAccessMode::READONLY);
|
||||
switch (e) {
|
||||
case REG_NO_ERROR:
|
||||
case RegError::NO_ERROR:
|
||||
break;
|
||||
case REG_REGISTRY_NOT_EXISTS:
|
||||
case RegError::REGISTRY_NOT_EXISTS:
|
||||
throw NoSuchFileException(uri);
|
||||
default:
|
||||
throw FileFormatException(
|
||||
uri, "cannot open legacy file: " + OUString::number(e));
|
||||
uri, "cannot open legacy file: " + OUString::number(static_cast<int>(e)));
|
||||
}
|
||||
RegistryKey root;
|
||||
e = reg.openRootKey(root);
|
||||
if (e != REG_NO_ERROR) {
|
||||
if (e != RegError::NO_ERROR) {
|
||||
throw FileFormatException(
|
||||
uri, "legacy format: cannot open root key: " + OUString::number(e));
|
||||
uri, "legacy format: cannot open root key: " + OUString::number(static_cast<int>(e)));
|
||||
}
|
||||
e = root.openKey("UCR", ucr_);
|
||||
switch (e) {
|
||||
case REG_NO_ERROR:
|
||||
case REG_KEY_NOT_EXISTS: // such effectively empty files exist in the wild
|
||||
case RegError::NO_ERROR:
|
||||
case RegError::KEY_NOT_EXISTS: // such effectively empty files exist in the wild
|
||||
break;
|
||||
default:
|
||||
throw FileFormatException(
|
||||
uri, "legacy format: cannot open UCR key: " + OUString::number(e));
|
||||
uri, "legacy format: cannot open UCR key: " + OUString::number(static_cast<int>(e)));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user