LibreOffice Module onlineupdate (master) 1
Namespaces | Classes | Typedefs | Functions
mozilla Namespace Reference

Compares two VersionParts. More...

Namespaces

namespace  detail
 

Classes

struct  AddLvalueReference
 AddLvalueReference adds an lvalue & reference to T if one isn't already present. More...
 
struct  AddRvalueReference
 AddRvalueReference adds an rvalue && reference to T if one isn't already present. More...
 
struct  Conditional
 Conditional selects a class between two, depending on a given boolean value. More...
 
struct  Conditional< false, A, B >
 
struct  EnableIf
 EnableIf is a struct containing a typedef of T if and only if B is true. More...
 
struct  EnableIf< true, T >
 
struct  IntegralConstant
 Helper class used as a base for various type traits, exposed publicly because <type_traits> exposes it as well. More...
 
struct  IsArithmetic
 IsArithmetic determines whether a type is arithmetic. More...
 
struct  IsArray
 IsArray determines whether a type is an array type, of known or unknown length. More...
 
struct  IsBaseOf
 
struct  IsClass
 IsClass determines whether a type is a class type (but not a union). More...
 
struct  IsConst
 IsConst determines whether a type is const or not. More...
 
struct  IsConst< const T >
 
struct  IsConvertible
 IsConvertible determines whether a value of type From will implicitly convert to a value of type To. More...
 
struct  IsConvertible< A, void >
 
struct  IsConvertible< void, B >
 
struct  IsConvertible< void, void >
 
struct  IsEmpty
 IsEmpty determines whether a type is a class (but not a union) that is empty. More...
 
struct  IsEnum
 IsEnum determines whether a type is an enum type. More...
 
struct  IsFloatingPoint
 IsFloatingPoint determines whether a type is a floating point type (float, double, long double). More...
 
struct  IsIntegral
 IsIntegral determines whether a type is an integral type. More...
 
struct  IsLvalueReference
 IsLvalueReference determines whether a type is an lvalue reference. More...
 
struct  IsLvalueReference< T & >
 
struct  IsPod
 Traits class for identifying POD types. More...
 
struct  IsPod< bool >
 
struct  IsPod< char >
 
struct  IsPod< double >
 
struct  IsPod< float >
 
struct  IsPod< int >
 
struct  IsPod< long >
 
struct  IsPod< long long >
 
struct  IsPod< short >
 
struct  IsPod< signed char >
 
struct  IsPod< T * >
 
struct  IsPod< unsigned char >
 
struct  IsPod< unsigned int >
 
struct  IsPod< unsigned long >
 
struct  IsPod< unsigned long long >
 
struct  IsPod< unsigned short >
 
struct  IsPod< wchar_t >
 
struct  IsPointer
 IsPointer determines whether a type is a possibly-CV-qualified pointer type (but not a pointer-to-member type). More...
 
struct  IsReference
 IsReference determines whether a type is an lvalue or rvalue reference. More...
 
struct  IsRvalueReference
 IsRvalueReference determines whether a type is an rvalue reference. More...
 
struct  IsRvalueReference< T && >
 
struct  IsSame
 IsSame tests whether two types are the same type. More...
 
struct  IsSame< T, T >
 
struct  IsSigned
 IsSigned determines whether a type is a signed arithmetic type. More...
 
struct  IsUnsigned
 IsUnsigned determines whether a type is an unsigned arithmetic type. More...
 
struct  IsVoid
 IsVoid determines whether a type is void. More...
 
struct  IsVolatile
 IsVolatile determines whether a type is volatile or not. More...
 
struct  IsVolatile< volatile T >
 
struct  MakeSigned
 MakeSigned produces the corresponding signed integer type for a given integral type T, with the const/volatile qualifiers of T. More...
 
struct  MakeUnsigned
 MakeUnsigned produces the corresponding unsigned integer type for a given integral type T, with the const/volatile qualifiers of T. More...
 
struct  RemoveConst
 RemoveConst removes top-level const qualifications on a type. More...
 
struct  RemoveConst< const T >
 
struct  RemoveCV
 RemoveCV removes top-level const and volatile qualifications on a type. More...
 
struct  RemoveExtent
 RemoveExtent produces either the type of the elements of the array T, or T itself. More...
 
struct  RemoveExtent< T[]>
 
struct  RemoveExtent< T[N]>
 
struct  RemovePointer
 Produces the pointed-to type if a pointer is provided, else returns the input type. More...
 
struct  RemoveReference
 Converts reference types to the underlying types. More...
 
struct  RemoveReference< T & >
 
struct  RemoveReference< T && >
 
struct  RemoveVolatile
 RemoveVolatile removes top-level volatile qualifications on a type. More...
 
struct  RemoveVolatile< volatile T >
 
struct  Version
 

Typedefs

typedef IntegralConstant< bool, true > TrueType
 Convenient aliases. More...
 
typedef IntegralConstant< bool, false > FalseType
 

Functions

int32_t CompareVersions (const char *aStrA, const char *aStrB)
 
template<typename T >
AddRvalueReference< T >::Type DeclVal ()
 DeclVal simplifies the definition of expressions which occur as unevaluated operands. More...
 

Detailed Description

Compares two VersionParts.

In order to compare version numbers in Mozilla, you need to use the mozilla::Version class.

You can construct an object of this type by passing in a string version number to the constructor. Objects of this type can be compared using the standard comparison operators.

For example, let's say that you want to make sure that a given version number is not older than 15.a2. Here's how you would write a function to do that.

bool IsVersionValid(const char* version) { return mozilla::Version("15.a2") <= mozilla::Version(version); }

Or, since Version's constructor is implicit, you can simplify this code:

bool IsVersionValid(const char* version) { return mozilla::Version("15.a2") <= version; }

On Windows, if your version strings are wide characters, you should use the mozilla::VersionW variant instead. The semantics of that class is the same as Version.

Typedef Documentation

◆ FalseType

typedef IntegralConstant<bool, false> mozilla::FalseType

Definition at line 44 of file TypeTraits.h.

◆ TrueType

typedef IntegralConstant<bool, true> mozilla::TrueType

Convenient aliases.

Definition at line 43 of file TypeTraits.h.

Function Documentation

◆ CompareVersions()

int32_t mozilla::CompareVersions ( const char *  aStrA,
const char *  aStrB 
)

◆ DeclVal()

template<typename T >
AddRvalueReference< T >::Type mozilla::DeclVal ( )

DeclVal simplifies the definition of expressions which occur as unevaluated operands.

It converts T to a reference type, making it possible to use in decltype expressions even if T does not have a default constructor, e.g.: decltype(DeclVal<TWithNoDefaultConstructor>().foo())