nsUConvPropertySearch.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. #ifndef nsUConvPropertySearch_h_
  5. #define nsUConvPropertySearch_h_
  6. #include "nsStringFwd.h"
  7. struct nsUConvProp
  8. {
  9. const char* const mKey;
  10. const char* const mValue;
  11. const uint32_t mValueLength;
  12. };
  13. class nsUConvPropertySearch
  14. {
  15. public:
  16. /**
  17. * Looks up a property by value.
  18. *
  19. * @param aProperties
  20. * the static property array
  21. * @param aKey
  22. * the key to look up
  23. * @param aValue
  24. * the return value (empty string if not found)
  25. * @return NS_OK if found or NS_ERROR_FAILURE if not found
  26. */
  27. static nsresult SearchPropertyValue(const nsUConvProp aProperties[],
  28. int32_t aNumberOfProperties,
  29. const nsACString& aKey,
  30. nsACString& aValue);
  31. };
  32. #endif /* nsUConvPropertySearch_h_ */