Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge main becasue of conflict #3972

Merged
merged 21 commits into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
deb847e
Add `$schema` to `cgmanifest.json` (#3918)
JamieMagee Sep 13, 2022
3fec13f
Remove SkipDefaultCheckout parameter (#3930)
azure-sdk Sep 14, 2022
0e00a3a
Compatibility improvement for striped blob (#3932)
microzchang Sep 15, 2022
17ca687
add a parameter 'condition' to the test-proxy ci invocations. (#3931)
azure-sdk Sep 15, 2022
a511ef6
storage ad-hoc release (#3934)
Jinming-Hu Sep 16, 2022
9b29538
Increment package version after release of azure-storage-blobs (#3935)
azure-sdk Sep 16, 2022
52f9437
Update `AttestationClient::AttestTpm` API to match existing `AttestOp…
penglimsft Sep 19, 2022
237c03a
Update check enforcer yaml permissions and name (#3944)
benbp Sep 19, 2022
9295737
Set VCPKG_ROOT (#3938)
danieljurek Sep 20, 2022
b809bf9
Sync the devops helper scripts between azure-sdk repo and tools repo …
azure-sdk Sep 20, 2022
14e4f52
Add Win32FileTimeConverter (#3941)
Jinming-Hu Sep 21, 2022
65ea32f
Sync eng/common directory with azure-sdk-tools for PR 4169 (#3950)
azure-sdk Sep 22, 2022
769b6c5
Enable Query() test in blob SDK (#3960)
Jinming-Hu Sep 22, 2022
68eea9a
Sync eng/common directory with azure-sdk-tools for PR 4212 (#3962)
azure-sdk Sep 22, 2022
c8d7961
Pipeline core (#3953)
gearama Sep 26, 2022
53797c8
Win32FileTimeConverter (#3967)
Jinming-Hu Sep 28, 2022
c4bece8
merge main
microzchang Sep 28, 2022
91c67f9
Sync eng/common directory with azure-sdk-tools for PR 4240 (#3965)
azure-sdk Sep 28, 2022
eb9c35d
Revert "Add Win32FileTimeConverter (#3941)" (#3966)
Jinming-Hu Sep 29, 2022
176ca9a
Merge branch 'feature/datalakestg82' of https://github.com/Azure/azur…
microzchang Sep 29, 2022
b685918
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-cpp int…
microzchang Sep 29, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/common/testproxy/target_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0-dev.20220922.1
1.0.0-dev.20220928.2
47 changes: 1 addition & 46 deletions sdk/core/azure-core/inc/azure/core/datetime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ inline bool operator>=(std::chrono::system_clock::time_point const& tp, DateTime

namespace Core { namespace _internal {
/**
* @brief Provides conversion methods for POSIX time to an #Azure::DateTime.
* @brief Provides convertion methods for POSIX time to an #Azure::DateTime.
*
*/
class PosixTimeConverter final {
Expand Down Expand Up @@ -311,51 +311,6 @@ namespace Core { namespace _internal {
*/
~PosixTimeConverter() = delete;
};

/**
* @brief Provides conversion methods for Win32 FILETIME to an #Azure::DateTime.
*
*/
class Win32FileTimeConverter final {
public:
/**
* @brief Converts Win32 FILETIME to an #Azure::DateTime.
*
* @param win32Filetime The number of 100-nanoseconds since 1601-01-01.
* @return Calculated #Azure::DateTime.
*/
static DateTime Win32FileTimeToDateTime(int64_t win32Filetime)
{
auto t = DateTime(1601) + Azure::_detail::Clock::duration(win32Filetime);
return DateTime(t);
}

/**
* @brief Converts a DateTime to Win32 FILETIME.
*
* @param dateTime The `%DateTime` to convert.
* @return The number of 100-nanoseconds since 1601-01-01.
*/
static int64_t DateTimeToWin32FileTime(DateTime const& dateTime)
{
return std::chrono::duration_cast<Azure::_detail::Clock::duration>(dateTime - DateTime(1601))
.count();
}

private:
/**
* @brief An instance of `%Win32FileTimeConverter` class cannot be created.
*
*/
Win32FileTimeConverter() = delete;

/**
* @brief An instance of `%Win32FileTimeConverter` class cannot be destructed, because no
* instance can be created.
*
*/
~Win32FileTimeConverter() = delete;
};
}} // namespace Core::_internal

} // namespace Azure
41 changes: 0 additions & 41 deletions sdk/core/azure-core/test/ut/datetime_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -895,44 +895,3 @@ TEST(DateTime, LeapYear)
EXPECT_NO_THROW(static_cast<void>(DateTime(2021, 2, 28)));
EXPECT_THROW(static_cast<void>(DateTime(2021, 2, 29)), std::invalid_argument);
}

TEST(DateTime, Win32FileTimeConverter)
{
using namespace Azure::Core::_internal;

EXPECT_EQ(
Win32FileTimeConverter::DateTimeToWin32FileTime(
Win32FileTimeConverter::Win32FileTimeToDateTime(0)),
0);
EXPECT_EQ(
Win32FileTimeConverter::DateTimeToWin32FileTime(
Win32FileTimeConverter::Win32FileTimeToDateTime(1)),
1);
EXPECT_EQ(
Win32FileTimeConverter::DateTimeToWin32FileTime(
Win32FileTimeConverter::Win32FileTimeToDateTime(133080315699856412)),
133080315699856412);
EXPECT_EQ(
Win32FileTimeConverter::DateTimeToWin32FileTime(
Win32FileTimeConverter::Win32FileTimeToDateTime(2650467743995784569)),
2650467743995784569);

EXPECT_EQ(
Win32FileTimeConverter::Win32FileTimeToDateTime(0).ToString(
Azure::DateTime::DateFormat::Rfc3339, Azure::DateTime::TimeFractionFormat::AllDigits),
"1601-01-01T00:00:00.0000000Z");
EXPECT_EQ(
Win32FileTimeConverter::Win32FileTimeToDateTime(1).ToString(
Azure::DateTime::DateFormat::Rfc3339, Azure::DateTime::TimeFractionFormat::AllDigits),
"1601-01-01T00:00:00.0000001Z");
EXPECT_EQ(
Win32FileTimeConverter::Win32FileTimeToDateTime(133080315699856412)
.ToString(
Azure::DateTime::DateFormat::Rfc3339, Azure::DateTime::TimeFractionFormat::AllDigits),
"2022-09-19T03:26:09.9856412Z");
EXPECT_EQ(
Win32FileTimeConverter::Win32FileTimeToDateTime(2650467743995784569)
.ToString(
Azure::DateTime::DateFormat::Rfc3339, Azure::DateTime::TimeFractionFormat::AllDigits),
"9999-12-31T23:59:59.5784569Z");
}