/usr/include/x86_64-linux-gnu/alljoyn/about/AboutPropertyStoreImpl.h is in liballjoyn-dev-1604 16.04a+dfsg.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 | /**
* @file
* Default implementation of the Property store
*/
/******************************************************************************
* Copyright AllSeen Alliance. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************************/
#ifndef ABOUTPROPERTYSTOREIMPL_H_
#define ABOUTPROPERTYSTOREIMPL_H_
#include <stdio.h>
#include <iostream>
#include <qcc/platform.h>
#include <alljoyn/about/AboutServiceApi.h>
#include <alljoyn/about/PropertyStore.h>
#include <alljoyn/about/PropertyStoreProperty.h>
namespace ajn {
namespace services {
/**
* enumerated list used to retrieve property store Field Names
*/
typedef enum {
DEVICE_ID = 0,
DEVICE_NAME = 1,
APP_ID = 2,
APP_NAME = 3,
DEFAULT_LANG = 4,
SUPPORTED_LANGS = 5,
DESCRIPTION = 6,
MANUFACTURER = 7,
DATE_OF_MANUFACTURE = 8,
MODEL_NUMBER = 9,
SOFTWARE_VERSION = 10,
AJ_SOFTWARE_VERSION = 11,
HARDWARE_VERSION = 12,
SUPPORT_URL = 13,
NUMBER_OF_KEYS = 14
} PropertyStoreKey;
/**
* multimap that will hold PropertyStoreProperties for each PropertyStoreKey
* Used to hold properties that are localizable
*/
typedef std::multimap<PropertyStoreKey, PropertyStoreProperty> PropertyMap;
/**
* Relate PropertyStoreKey with its PropertyStorePoperty
* Used to hold properties that are not localizable
*/
typedef std::pair<PropertyStoreKey, PropertyStoreProperty> PropertyPair;
/**
* AboutPropertyStoreImpl
* About property store implementation
*
* @deprecated The AboutPropertyStoreImpl class has been deprecated please see the
* AboutData class for similar functionality as the AboutPropertyStoreImpl class.
*/
class AboutPropertyStoreImpl : public PropertyStore {
public:
/**
* AboutPropertyStoreImpl
*
* @deprecated The AboutPropertyStoreImpl class has been deprecated please see the
* AboutData class.
*/
QCC_DEPRECATED(AboutPropertyStoreImpl());
/**
* ~AboutPropertyStoreImpl
*
* @deprecated The AboutPropertyStoreImpl class has been deprecated please see the
* AboutData class.
*/
QCC_DEPRECATED(virtual ~AboutPropertyStoreImpl());
/**
* ReadAll
* @param[in] languageTag
* @param[in] filter
* @param[out] all
* @return
* - ER_OK if successful.
* - an error status if otherwise
*/
QCC_DEPRECATED(virtual QStatus ReadAll(const char* languageTag, Filter filter, ajn::MsgArg & all));
/**
* Update
*
* @deprecated The AboutPropertyStoreImpl class has been deprecated please
* see the AboutData class.
*
* @param[in] name
* @param[in] languageTag
* @param[in] value
* @return
* - ER_OK if successful.
* - an error status if otherwise
*/
QCC_DEPRECATED(virtual QStatus Update(const char* name, const char* languageTag, const ajn::MsgArg * value));
/**
* Delete
*
* @deprecated The AboutPropertyStoreImpl class has been deprecated please
* see the AboutData class.
*
* @param[in] name
* @param[in] languageTag
* @return
* - ER_OK if successful.
* - an error status if otherwise
*/
QCC_DEPRECATED(virtual QStatus Delete(const char* name, const char* languageTag));
/**
* getProperty
*
* @deprecated The AboutPropertyStoreImpl::getProperty function has been
* deprecated please see the AboutData::GetField function.
*
* @param[in] propertyKey
* @return PropertyStoreProperty.
*/
QCC_DEPRECATED(PropertyStoreProperty * getProperty(PropertyStoreKey propertyKey));
/**
* getProperty
*
* @deprecated The AboutPropertyStoreImpl::getProperty function has been
* deprecated please see the AboutData::GetField function.
*
* @param[in] propertyKey
* @param[in] language
* @return PropertyStoreProperty.
*/
QCC_DEPRECATED(PropertyStoreProperty * getProperty(PropertyStoreKey propertyKey, qcc::String const & language));
/**
* setDeviceId
*
* @deprecated The AboutPropertyStoreImpl::setDeviceId function has been
* deprecated please see the AboutData::SetDeviceId function.
*
* @param[in] deviceId
* @param[in] isPublic
* @param[in] isWritable
* @param[in] isAnnouncable
* @return QStatus
*/
QCC_DEPRECATED(QStatus setDeviceId(qcc::String const & deviceId, bool isPublic = true, bool isWritable = false, bool isAnnouncable = true));
/**
* setDeviceName
*
* @deprecated The AboutPropertyStoreImpl::setDeviceName function has been
* deprecated please see the AboutData::SetDeviceName function.
*
* @param[in] deviceName
* @param[in] language
* @param[in] isPublic
* @param[in] isWritable
* @param[in] isAnnouncable
* @return QStatus.
*/
QCC_DEPRECATED(QStatus setDeviceName(qcc::String const & deviceName, qcc::String const& language = "", bool isPublic = true, bool isWritable = true, bool isAnnouncable = true));
/**
* setAppId
*
* @deprecated The AboutPropertyStoreImpl::setAppId function has been
* deprecated please see the AboutData::SetAppId function.
*
* @param[in] appId
* @param[in] isPublic
* @param[in] isWritable
* @param[in] isAnnouncable
* @return QStatus.
*/
QCC_DEPRECATED(QStatus setAppId(qcc::String const & appId, bool isPublic = true, bool isWritable = false, bool isAnnouncable = true));
/**
* setAppName
*
* @deprecated The AboutPropertyStoreImpl::setAppName function has been
* deprecated please see the AboutData::SetAppName function.
*
* @param[in] appName
* @param[in] language
* @param[in] isPublic
* @param[in] isWritable
* @param[in] isAnnouncable
* @return QStatus.
*/
QCC_DEPRECATED(QStatus setAppName(qcc::String const & appName, qcc::String const& language = "", bool isPublic = true, bool isWritable = false, bool isAnnouncable = true));
/**
* setDefaultLang
*
* The default language must already be in the list of supported languages or
* it will return status ER_LANGUAGE_NOT_SUPPORTED
*
* @deprecated The AboutPropertyStoreImpl::setDefaultLang function has been
* deprecated please see the AboutData::SetDefaultLanguage function.
*
* @param[in] defaultLang
* @param[in] isPublic
* @param[in] isWritable
* @param[in] isAnnouncable
* @return QStatus
*
* - ER_OK on success
* - ER_LANGUAGE_NOT_SUPPORTED if language is not in supporte languages
* - status indicating failure
*
*/
QCC_DEPRECATED(QStatus setDefaultLang(qcc::String const & defaultLang, bool isPublic = true, bool isWritable = true, bool isAnnouncable = true));
/**
* setSupportedLangs
*
* @deprecated The AboutPropertyStoreImpl::setSupportedLangs function has been
* deprecated please see the AboutData::SetSupportedLanguage function.
*
* @param[in] supportedLangs
* @param[in] isPublic
* @param[in] isWritable
* @param[in] isAnnouncable
* @return QStatus.
*/
QCC_DEPRECATED(QStatus setSupportedLangs(std::vector<qcc::String> const & supportedLangs, bool isPublic = true, bool isWritable = false, bool isAnnouncable = false));
/**
* setDescription
*
* @deprecated The AboutPropertyStoreImpl::setDescription function has been
* deprecated please see the AboutData::SetDescription function.
*
* @param[in] description
* @param[in] language
* @param[in] isPublic
* @param[in] isWritable
* @param[in] isAnnouncable
* @return QStatus.
*/
QCC_DEPRECATED(QStatus setDescription(qcc::String const & description, qcc::String const& language = "", bool isPublic = true, bool isWritable = false, bool isAnnouncable = false));
/**
* setManufacturer
*
* @deprecated The AboutPropertyStoreImpl::setManufacturer function has been
* deprecated please see the AboutData::SetManufacturer function.
*
* @param[in] manufacturer
* @param[in] language
* @param[in] isPublic
* @param[in] isWritable
* @param[in] isAnnouncable
* @return QStatus.
*/
QCC_DEPRECATED(QStatus setManufacturer(qcc::String const & manufacturer, qcc::String const& language = "", bool isPublic = true, bool isWritable = false, bool isAnnouncable = true));
/**
* setDateOfManufacture
*
* @deprecated The AboutPropertyStoreImpl::setManufacturer function has been
* deprecated please see the AboutData::SetManufacturer function.
*
* Using format YYYY-MM-DD (Known as XML DateTime Format)
* @param[in] dateOfManufacture
* @param[in] isPublic
* @param[in] isWritable
* @param[in] isAnnouncable
* @return QStatus.
*/
QCC_DEPRECATED(QStatus setDateOfManufacture(qcc::String const & dateOfManufacture, bool isPublic = true, bool isWritable = false, bool isAnnouncable = false));
/**
* setSoftwareVersion
*
* @deprecated The AboutPropertyStoreImpl::setSoftwareVersion function has been
* deprecated please see the AboutData::SetSoftwareVersion function.
*
* @param[in] softwareVersion
* @param[in] isPublic
* @param[in] isWritable
* @param[in] isAnnouncable
* @return QStatus.
*/
QCC_DEPRECATED(QStatus setSoftwareVersion(qcc::String const & softwareVersion, bool isPublic = true, bool isWritable = false, bool isAnnouncable = false));
/**
* setAjSoftwareVersion
*
* @deprecated The AboutPropertyStoreImpl::setAjSoftwareVersion function has been
* deprecated please see the AboutData class.
*
* @param[in] ajSoftwareVersion
* @param[in] isPublic
* @param[in] isWritable
* @param[in] isAnnouncable
* @return QStatus.
*/
QCC_DEPRECATED(QStatus setAjSoftwareVersion(qcc::String const & ajSoftwareVersion, bool isPublic = true, bool isWritable = false, bool isAnnouncable = false));
/**
* setHardwareVersion
*
* @deprecated The AboutPropertyStoreImpl::setHardwareVersion function has been
* deprecated please see the AboutData::SetHardwareVersion function.
*
* @param[in] hardwareVersion
* @param[in] isPublic
* @param[in] isWritable
* @param[in] isAnnouncable
* @return QStatus.
*/
QCC_DEPRECATED(QStatus setHardwareVersion(qcc::String const & hardwareVersion, bool isPublic = true, bool isWritable = false, bool isAnnouncable = false));
/**
* setModelNumber
*
* @deprecated The AboutPropertyStoreImpl::setModelNumber function has been
* deprecated please see the AboutData::SetModelNumber function.
*
* @param[in] modelNumber
* @param[in] isPublic
* @param[in] isWritable
* @param[in] isAnnouncable
* @return QStatus.
*/
QCC_DEPRECATED(QStatus setModelNumber(qcc::String const & modelNumber, bool isPublic = true, bool isWritable = false, bool isAnnouncable = true));
/**
* setSupportUrl
*
* @deprecated The AboutPropertyStoreImpl::setSupportUrl function has been
* deprecated please see the AboutData::SetSupportUrl function.
*
* @param[in] supportUrl
* @param[in] language
* @param[in] isPublic
* @param[in] isWritable
* @param[in] isAnnouncable
* @return QStatus.
*/
QCC_DEPRECATED(QStatus setSupportUrl(qcc::String const & supportUrl, qcc::String const& language = "", bool isPublic = true, bool isWritable = false, bool isAnnouncable = false));
/**
* getPropertyStoreName
*
* @deprecated The AboutPropertyStoreImpl::getPropertyStoreName function has been
* deprecated please see the AboutData class.
*
* @param[in] propertyStoreKey
* @return static qcc::String const&
*/
QCC_DEPRECATED(static qcc::String const & getPropertyStoreName(PropertyStoreKey propertyStoreKey));
protected:
/**
* m_Properties
*/
PropertyMap m_Properties;
/**
* m_PropertyStoreName
*/
static qcc::String PropertyStoreName[NUMBER_OF_KEYS + 1];
/**
* isLanguageSupported
* @param[in] language
* @return
* - ER_OK if language is supported
* - ER_LANGUAGE_NOT_SUPPORTED if language is not supported
*/
QCC_DEPRECATED(QStatus isLanguageSupported(const char* language));
/**
* m_SupportedLangs Stores the supported languages
*/
std::vector<qcc::String> m_SupportedLangs;
/**
* removeExisting
* @param[in] propertyKey the value to be removed from the PropertyStore
* @return true if property was found and removed.
* returning false most likely means the property key was not found
*/
QCC_DEPRECATED(bool removeExisting(PropertyStoreKey propertyKey));
/**
* removeExisting
* @param[in] propertyKey
* @param[in] language
* @return true if property was found and removed.
* returning false most likely means the property key was nto found or the was
* not a key for the specified language
*/
QCC_DEPRECATED(bool removeExisting(PropertyStoreKey propertyKey, qcc::String const & language));
/**
* validateValue
* @param[in] propertyKey
* @param[in] value
* @param[in] languageTag
* @return QStatus
*/
QCC_DEPRECATED(QStatus validateValue(PropertyStoreKey propertyKey, ajn::MsgArg const & value, qcc::String const& languageTag = ""));
/**
* setProperty
* @param[in] propertyKey
* @param[in] value
* @param[in] isPublic
* @param[in] isWritable
* @param[in] isAnnouncable
* @return QStatus
*/
QCC_DEPRECATED(QStatus setProperty(PropertyStoreKey propertyKey, const qcc::String & value, bool isPublic, bool isWritable, bool isAnnouncable));
/**
* setProperty
* @param[in] propertyKey
* @param[in] value
* @param[in] language
* @param[in] isPublic
* @param[in] isWritable
* @param[in] isAnnouncable
* @return QStatus
*/
QCC_DEPRECATED(QStatus setProperty(PropertyStoreKey propertyKey, const qcc::String & value, const qcc::String & language, bool isPublic,
bool isWritable, bool isAnnouncable));
};
} /* namespace services */
} /* namespace ajn */
#endif /* ABOUTPROPERTYSTOREIMPL_H_ */
|