SQLFunctions.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
  2. * This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef mozilla_downloads_SQLFunctions_h
  6. #define mozilla_downloads_SQLFunctions_h
  7. #include "mozIStorageFunction.h"
  8. #include "mozilla/Attributes.h"
  9. class nsCString;
  10. class mozIStorageConnection;
  11. namespace mozilla {
  12. namespace downloads {
  13. /**
  14. * SQL function to generate a GUID for a place or bookmark item. This is just
  15. * a wrapper around GenerateGUID in SQLFunctions.cpp.
  16. *
  17. * @return a guid for the item.
  18. * @see toolkit/components/places/SQLFunctions.h - keep this in sync
  19. */
  20. class GenerateGUIDFunction final : public mozIStorageFunction
  21. {
  22. ~GenerateGUIDFunction() {}
  23. public:
  24. NS_DECL_THREADSAFE_ISUPPORTS
  25. NS_DECL_MOZISTORAGEFUNCTION
  26. /**
  27. * Registers the function with the specified database connection.
  28. *
  29. * @param aDBConn
  30. * The database connection to register with.
  31. */
  32. static nsresult create(mozIStorageConnection *aDBConn);
  33. };
  34. nsresult GenerateGUID(nsCString& _guid);
  35. } // namespace downloads
  36. } // namespace mozilla
  37. #endif