nsVersionComparatorImpl.cpp 790 B

12345678910111213141516171819202122
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  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. #include "nsVersionComparatorImpl.h"
  6. #include "nsVersionComparator.h"
  7. #include "nsString.h"
  8. NS_IMPL_ISUPPORTS(nsVersionComparatorImpl, nsIVersionComparator)
  9. NS_IMETHODIMP
  10. nsVersionComparatorImpl::Compare(const nsACString& aStr1,
  11. const nsACString& aStr2,
  12. int32_t* aResult)
  13. {
  14. *aResult = mozilla::CompareVersions(PromiseFlatCString(aStr1).get(),
  15. PromiseFlatCString(aStr2).get());
  16. return NS_OK;
  17. }