Guid.h 456 Bytes
Newer Older
gladish's avatar
gladish committed
1 2 3
#pragma once

#include <uuid/uuid.h>
4
#include <string>
gladish's avatar
gladish committed
5

gladish's avatar
gladish committed
6
namespace common
gladish's avatar
gladish committed
7 8 9 10
{
  class Guid
  {
  public:
11
    static Guid const& Null();
Jacob Gladish's avatar
Jacob Gladish committed
12

13 14
    static Guid NewGuid();
    static Guid Parse(char const* s);
gladish's avatar
gladish committed
15

16
    std::string ToString() const;
gladish's avatar
gladish committed
17

18 19 20
    bool operator <  (Guid const& rhs) const;
    bool operator == (Guid const& rhs) const;
    bool operator != (Guid const& rhs) const;
gladish's avatar
gladish committed
21 22

  private:
23 24
    Guid();
    Guid(uuid_t id);
gladish's avatar
gladish committed
25 26

  private:
27
    uuid_t m_uuid;
gladish's avatar
gladish committed
28 29
  };
}