libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
WindowsTime.hh
Go to the documentation of this file.
1/*
2 * Copyright 2021 Assured Information Security, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#pragma once
17
18#include <cstdint>
19#include <memory>
20#include <string>
21
22namespace introvirt {
23namespace windows {
24
33class WindowsTime final {
34 public:
41 static WindowsTime from_windows_time(uint64_t winTime);
42
49 static WindowsTime from_unix_time(uint64_t unixTime);
50
51 public:
55 uint64_t windows_time() const;
56 operator uint64_t() const;
57
61 uint64_t unix_time() const;
62
66 std::string string() const;
67
71 WindowsTime(const WindowsTime& other);
72
77
81 WindowsTime(WindowsTime&& other) noexcept;
82
86 WindowsTime& operator=(WindowsTime&& other) noexcept;
87
88 ~WindowsTime() = default;
89
90 private:
95
96 private:
97 uint64_t windows_time_;
98};
99
100std::string to_string(const WindowsTime& time);
101
102std::ostream& operator<<(std::ostream& os, const WindowsTime& time);
103
104} /* namespace windows */
105} /* namespace introvirt */
Helper class for the Windows time format.
Definition WindowsTime.hh:33
std::string string() const
WindowsTime & operator=(const WindowsTime &other)
Copy assignment operator.
static WindowsTime from_windows_time(uint64_t winTime)
static WindowsTime from_unix_time(uint64_t unixTime)
WindowsTime(WindowsTime &&other) noexcept
Move constructor.
WindowsTime & operator=(WindowsTime &&other) noexcept
Move assignment operator.
WindowsTime(const WindowsTime &other)
Copy constructor.
std::ostream & operator<<(std::ostream &os, const Utf16String &str)
const std::string & to_string(const Utf16String &)
Core IntroVirt classes.
Definition Cr0.hh:20