Azure::Core::DateTime => Azure::DateTime (#1836)

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
This commit is contained in:
Anton Kolesnyk 2021-03-10 14:44:09 -08:00 committed by GitHub
parent 7fca169d25
commit 76870c4414
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 916 additions and 1034 deletions

View File

@ -39,6 +39,7 @@
- Moved `Azure::Core::Response<T>` to `Azure::Response<T>`.
- Moved types in the `Azure::IO` namespace like `BodyStream` to `Azure::Core::IO`.
- Moved `Azure::Core::ETag` to `Azure::ETag`.
- Moved `Azure::Core::DateTime` to `Azure::DateTime`.
### Bug Fixes

View File

@ -14,252 +14,254 @@
#include <ostream>
#include <string>
namespace Azure { namespace Core {
namespace _detail {
class Clock {
public:
using rep = int64_t;
using period = std::ratio<1, 10000000>;
using duration = std::chrono::duration<rep, period>;
using time_point = std::chrono::time_point<Clock>;
namespace Azure {
// since now() calls system_clock::now(), we have the same to say about the clock steadiness.
// system_clock is not a steady clock. It is calendar-based, which means it can be adjusted,
// and it may go backwards in time after adjustments, or jump forward faster than the actual
// time passes, if you catch the moment before and after syncing the clock.
// Steady clock would be good for measuring elapsed time without reboots (or hybernation?).
// Steady clock's epoch = boot time, and it would only go forward in steady fashion, after the
// system has started.
// Using this clock in combination with system_clock is common scenario.
// It would not be possible to base this clock on steady_clock and provide an implementation
// that universally works in any context in predictable manner. However, it does not mean that
// implementation can't use steady_clock in conjunction with this clock: an author can get a
// duration between two time_points of this clock (or between system_clock::time point at
// this clock's time_point), and add that duration to steady clock's time_point to get a new
// time_point in the steady clock's "coordinate system".
static constexpr bool is_steady = std::chrono::system_clock::is_steady;
static time_point now() noexcept;
};
} // namespace _detail
namespace _detail {
class Clock {
public:
using rep = int64_t;
using period = std::ratio<1, 10000000>;
using duration = std::chrono::duration<rep, period>;
using time_point = std::chrono::time_point<Clock>;
// since now() calls system_clock::now(), we have the same to say about the clock steadiness.
// system_clock is not a steady clock. It is calendar-based, which means it can be adjusted,
// and it may go backwards in time after adjustments, or jump forward faster than the actual
// time passes, if you catch the moment before and after syncing the clock.
// Steady clock would be good for measuring elapsed time without reboots (or hybernation?).
// Steady clock's epoch = boot time, and it would only go forward in steady fashion, after the
// system has started.
// Using this clock in combination with system_clock is common scenario.
// It would not be possible to base this clock on steady_clock and provide an implementation
// that universally works in any context in predictable manner. However, it does not mean that
// implementation can't use steady_clock in conjunction with this clock: an author can get a
// duration between two time_points of this clock (or between system_clock::time point at
// this clock's time_point), and add that duration to steady clock's time_point to get a new
// time_point in the steady clock's "coordinate system".
static constexpr bool is_steady = std::chrono::system_clock::is_steady;
static time_point now() noexcept;
};
} // namespace _detail
/**
* @brief Manages date and time in standardized string formats.
* @details Supports date range from year 0001 to end of year 9999 with 100ns (7 decimal places
* for fractional second) precision.
* @remark `std::chrono::system_clock::time_point` can't be used, because there is no guarantees
* for the date range and precision.
* @remark This class is supposed to be able to handle a DateTime that comes over the wire.
*/
class DateTime : public _detail::Clock::time_point {
AZ_CORE_DLLEXPORT static DateTime const SystemClockEpoch;
public:
/**
* @brief Construct a default instance of #Azure::DateTime (00:00:00.0000000 on Janualy
* 1st, 0001).
*/
constexpr DateTime() : time_point() {}
private:
DateTime(
int16_t year,
int8_t month,
int8_t day,
int8_t hour,
int8_t minute,
int8_t second,
int32_t fracSec,
int8_t dayOfWeek,
int8_t localDiffHours,
int8_t localDiffMinutes,
bool roundFracSecUp = false);
void ThrowIfUnsupportedYear() const;
void GetDateTimeParts(
int16_t* year,
int8_t* month,
int8_t* day,
int8_t* hour,
int8_t* minute,
int8_t* second,
int32_t* fracSec,
int8_t* dayOfWeek) const;
std::string ToStringRfc1123() const;
public:
/**
* @brief Construct an instance of #Azure::DateTime.
*
* @param year Year.
* @param month Month.
* @param day Day.
* @param hour Hour.
* @param minute Minute.
* @param second Seconds.
*
* @throw std::invalid_argument If any parameter is invalid.
*/
explicit DateTime(
int16_t year,
int8_t month = 1,
int8_t day = 1,
int8_t hour = 0,
int8_t minute = 0,
int8_t second = 0)
: DateTime(year, month, day, hour, minute, second, 0, -1, 0, 0)
{
}
/**
* @brief Manages date and time in standardized string formats.
* @details Supports date range from year 0001 to end of year 9999 with 100ns (7 decimal places
* for fractional second) precision.
* @remark `std::chrono::system_clock::time_point` can't be used, because there is no guarantees
* for the date range and precision.
* @remark This class is supposed to be able to handle a DateTime that comes over the wire.
* @brief Construct an instance of #Azure::DateTime from base class.
*/
class DateTime : public _detail::Clock::time_point {
AZ_CORE_DLLEXPORT static DateTime const SystemClockEpoch;
constexpr DateTime(time_point const& timePoint) : time_point(timePoint) {}
public:
/**
* @brief Construct a default instance of #Azure::Core::DateTime (00:00:00.0000000 on Janualy
* 1st, 0001).
*/
constexpr DateTime() : time_point() {}
/**
* @brief Construct an instance of #Azure::DateTime from
* `std::chrono::system_clock::time_point`.
* @param systemTime A value of `std::chrono::system_clock::time_point`.
*/
DateTime(std::chrono::system_clock::time_point const& systemTime)
: DateTime(
SystemClockEpoch + std::chrono::duration_cast<duration>(systemTime.time_since_epoch()))
{
}
private:
DateTime(
int16_t year,
int8_t month,
int8_t day,
int8_t hour,
int8_t minute,
int8_t second,
int32_t fracSec,
int8_t dayOfWeek,
int8_t localDiffHours,
int8_t localDiffMinutes,
bool roundFracSecUp = false);
/**
* @brief Convert an instance of #Azure::DateTime to
* `std::chrono::system_clock::time_point`.
* @throw std::invalid_argument if #Azure::DateTime is outside of the range that can be
* represented.
*/
explicit operator std::chrono::system_clock::time_point() const;
void ThrowIfUnsupportedYear() const;
/**
* @brief Defines the format applied to the fraction part of any #Azure::DateTime.
*/
enum class TimeFractionFormat
{
/// Include only meaningful fractional time digits, up to and excluding trailing zeroes.
DropTrailingZeros,
void GetDateTimeParts(
int16_t* year,
int8_t* month,
int8_t* day,
int8_t* hour,
int8_t* minute,
int8_t* second,
int32_t* fracSec,
int8_t* dayOfWeek) const;
/// Include all the fractional time digits up to maximum precision, even if the entire value
/// is zero.
AllDigits,
std::string ToStringRfc1123() const;
public:
/**
* @brief Construct an instance of #Azure::Core::DateTime.
*
* @param year Year.
* @param month Month.
* @param day Day.
* @param hour Hour.
* @param minute Minute.
* @param second Seconds.
*
* @throw std::invalid_argument If any parameter is invalid.
*/
explicit DateTime(
int16_t year,
int8_t month = 1,
int8_t day = 1,
int8_t hour = 0,
int8_t minute = 0,
int8_t second = 0)
: DateTime(year, month, day, hour, minute, second, 0, -1, 0, 0)
{
}
/**
* @brief Construct an instance of #Azure::Core::DateTime from base class.
*/
constexpr DateTime(time_point const& timePoint) : time_point(timePoint) {}
/**
* @brief Construct an instance of #Azure::Core::DateTime from
* `std::chrono::system_clock::time_point`.
* @param systemTime A value of `std::chrono::system_clock::time_point`.
*/
DateTime(std::chrono::system_clock::time_point const& systemTime)
: DateTime(
SystemClockEpoch + std::chrono::duration_cast<duration>(systemTime.time_since_epoch()))
{
}
/**
* @brief Convert an instance of #Azure::Core::DateTime to
* `std::chrono::system_clock::time_point`.
* @throw std::invalid_argument if #Azure::Core::DateTime is outside of the range that can be
* represented.
*/
explicit operator std::chrono::system_clock::time_point() const;
/**
* @brief Defines the format applied to the fraction part of any #Azure::Core::DateTime.
*/
enum class TimeFractionFormat
{
/// Include only meaningful fractional time digits, up to and excluding trailing zeroes.
DropTrailingZeros,
/// Include all the fractional time digits up to maximum precision, even if the entire value
/// is zero.
AllDigits,
/// Drop all the fractional time digits.
Truncate
};
/**
* @brief Defines the supported date and time string formats.
*/
enum class DateFormat
{
/// RFC 1123.
Rfc1123,
/// RFC 3339.
Rfc3339,
};
/**
* @brief Create #Azure::Core::DateTime from a string representing time in UTC in the specified
* format.
*
* @param dateTime A string with the date and time.
* @param format A format to which \p dateTime string adheres to.
*
* @return #Azure::Core::DateTime that was constructed from the \p dateTime string.
*
* @throw std::invalid_argument If \p format is not recognized, or if parsing error.
*/
static DateTime Parse(std::string const& dateTime, DateFormat format);
/**
* @brief Get a string representation of the #Azure::Core::DateTime.
*
* @param format The representation format to use, defaulted to use RFC 3339.
*
* @throw std::invalid_argument If year exceeds 9999, or if \p format is not recognized.
*/
std::string ToString(DateFormat format = DateFormat::Rfc3339) const;
/**
* @brief Get a string representation of the #Azure::Core::DateTime.
*
* @param format The representation format to use.
* @param fractionFormat The format for the fraction part of the DateTime. Only
* supported by RFC3339.
*
* @throw std::invalid_argument If year exceeds 9999, or if \p format is not recognized.
*/
std::string ToString(DateFormat format, TimeFractionFormat fractionFormat) const;
/// Drop all the fractional time digits.
Truncate
};
inline _detail::Clock::time_point _detail::Clock::now() noexcept
/**
* @brief Defines the supported date and time string formats.
*/
enum class DateFormat
{
return DateTime(std::chrono::system_clock::now());
}
/// RFC 1123.
Rfc1123,
inline bool operator==(DateTime const& dt, std::chrono::system_clock::time_point const& tp)
{
return dt == DateTime(tp);
}
/// RFC 3339.
Rfc3339,
};
inline bool operator<(DateTime const& dt, std::chrono::system_clock::time_point const& tp)
{
return dt < DateTime(tp);
}
/**
* @brief Create #Azure::DateTime from a string representing time in UTC in the specified
* format.
*
* @param dateTime A string with the date and time.
* @param format A format to which \p dateTime string adheres to.
*
* @return #Azure::DateTime that was constructed from the \p dateTime string.
*
* @throw std::invalid_argument If \p format is not recognized, or if parsing error.
*/
static DateTime Parse(std::string const& dateTime, DateFormat format);
inline bool operator<=(DateTime const& dt, std::chrono::system_clock::time_point const& tp)
{
return dt <= DateTime(tp);
}
/**
* @brief Get a string representation of the #Azure::DateTime.
*
* @param format The representation format to use, defaulted to use RFC 3339.
*
* @throw std::invalid_argument If year exceeds 9999, or if \p format is not recognized.
*/
std::string ToString(DateFormat format = DateFormat::Rfc3339) const;
inline bool operator!=(DateTime const& dt, std::chrono::system_clock::time_point const& tp)
{
return !(dt == tp);
}
/**
* @brief Get a string representation of the #Azure::DateTime.
*
* @param format The representation format to use.
* @param fractionFormat The format for the fraction part of the DateTime. Only
* supported by RFC3339.
*
* @throw std::invalid_argument If year exceeds 9999, or if \p format is not recognized.
*/
std::string ToString(DateFormat format, TimeFractionFormat fractionFormat) const;
};
inline bool operator>(DateTime const& dt, std::chrono::system_clock::time_point const& tp)
{
return !(dt <= tp);
}
inline _detail::Clock::time_point _detail::Clock::now() noexcept
{
return DateTime(std::chrono::system_clock::now());
}
inline bool operator>=(DateTime const& dt, std::chrono::system_clock::time_point const& tp)
{
return !(dt < tp);
}
inline bool operator==(DateTime const& dt, std::chrono::system_clock::time_point const& tp)
{
return dt == DateTime(tp);
}
inline bool operator==(std::chrono::system_clock::time_point const& tp, DateTime const& dt)
{
return dt == tp;
}
inline bool operator<(DateTime const& dt, std::chrono::system_clock::time_point const& tp)
{
return dt < DateTime(tp);
}
inline bool operator!=(std::chrono::system_clock::time_point const& tp, DateTime const& dt)
{
return dt != tp;
}
inline bool operator<=(DateTime const& dt, std::chrono::system_clock::time_point const& tp)
{
return dt <= DateTime(tp);
}
inline bool operator<(std::chrono::system_clock::time_point const& tp, DateTime const& dt)
{
return (dt > tp);
}
inline bool operator!=(DateTime const& dt, std::chrono::system_clock::time_point const& tp)
{
return !(dt == tp);
}
inline bool operator<=(std::chrono::system_clock::time_point const& tp, DateTime const& dt)
{
return (dt >= tp);
}
inline bool operator>(DateTime const& dt, std::chrono::system_clock::time_point const& tp)
{
return !(dt <= tp);
}
inline bool operator>(std::chrono::system_clock::time_point const& tp, DateTime const& dt)
{
return (dt < tp);
}
inline bool operator>=(DateTime const& dt, std::chrono::system_clock::time_point const& tp)
{
return !(dt < tp);
}
inline bool operator>=(std::chrono::system_clock::time_point const& tp, DateTime const& dt)
{
return (dt <= tp);
}
}} // namespace Azure::Core
inline bool operator==(std::chrono::system_clock::time_point const& tp, DateTime const& dt)
{
return dt == tp;
}
inline bool operator!=(std::chrono::system_clock::time_point const& tp, DateTime const& dt)
{
return dt != tp;
}
inline bool operator<(std::chrono::system_clock::time_point const& tp, DateTime const& dt)
{
return (dt > tp);
}
inline bool operator<=(std::chrono::system_clock::time_point const& tp, DateTime const& dt)
{
return (dt >= tp);
}
inline bool operator>(std::chrono::system_clock::time_point const& tp, DateTime const& dt)
{
return (dt < tp);
}
inline bool operator>=(std::chrono::system_clock::time_point const& tp, DateTime const& dt)
{
return (dt <= tp);
}
} // namespace Azure

View File

@ -24,11 +24,11 @@ struct ModifiedConditions
* @brief Optionally limit requests to resources that have only been modified since this point
* in time.
*/
Azure::Core::Nullable<Azure::Core::DateTime> IfModifiedSince;
Azure::Core::Nullable<Azure::DateTime> IfModifiedSince;
/**
* @brief Optionally limit requests to resources that have remained unmodified.
*/
Azure::Core::Nullable<Azure::Core::DateTime> IfUnmodifiedSince;
Azure::Core::Nullable<Azure::DateTime> IfUnmodifiedSince;
};
} // namespace Azure

View File

@ -12,7 +12,7 @@
#include <sstream>
#include <stdexcept>
using namespace Azure::Core;
using namespace Azure;
namespace {
DateTime GetSystemClockEpoch()
@ -61,7 +61,7 @@ void ValidateDateElementRange(
if (outOfRange != 0)
{
throw std::invalid_argument(
"Azure::Core::DateTime " + valueName + " (" + std::to_string(value) + ") cannot be "
"Azure::DateTime " + valueName + " (" + std::to_string(value) + ") cannot be "
+ (outOfRange < 0 ? std::string("less than ") + std::to_string(minValue)
: std::string("greater than ") + std::to_string(maxValue))
+ ".");
@ -174,14 +174,14 @@ void ValidateDate(
if (day > maxDay)
{
throw std::invalid_argument(
"Azure::Core::DateTime: invalid month day number (month: " + std::to_string(month)
"Azure::DateTime: invalid month day number (month: " + std::to_string(month)
+ ", day: " + std::to_string(day) + ", maximum: " + std::to_string(maxDay) + ").");
}
if (!IsLeapYear(year) && month == 2 && day == 29)
{
throw std::invalid_argument(
"Azure::Core::DateTime: year " + std::to_string(year)
"Azure::DateTime: year " + std::to_string(year)
+ "is not a leap year, and therefore does not have February 29th.");
}
@ -192,8 +192,8 @@ void ValidateDate(
if (dayOfWeek != expectedDayOfWeek)
{
throw std::invalid_argument(
"Azure::Core::DateTime: incorrect day of week specified (actual: "
+ std::to_string(dayOfWeek) + ", expected: " + std::to_string(expectedDayOfWeek) + ").");
"Azure::DateTime: incorrect day of week specified (actual: " + std::to_string(dayOfWeek)
+ ", expected: " + std::to_string(expectedDayOfWeek) + ").");
}
}
@ -424,7 +424,7 @@ DateTime::operator std::chrono::system_clock::time_point() const
if (outOfRange != 0)
{
throw std::invalid_argument(
std::string("Cannot represent Azure::Core::DateTime as "
std::string("Cannot represent Azure::DateTime as "
"std::chrono::system_clock::time_point: value is too ")
+ (outOfRange < 0 ? "small." : "big."));
}
@ -747,7 +747,7 @@ void DateTime::ThrowIfUnsupportedYear() const
if (outOfRange != 0)
{
throw std::invalid_argument(
std::string("Cannot represent Azure::Core::DateTime as std::string: the date is ")
std::string("Cannot represent Azure::DateTime as std::string: the date is ")
+ (outOfRange < 0 ? "before 0001-01-01." : "after 9999-12-31 23:59:59.9999999."));
}
}

View File

@ -133,7 +133,7 @@ Logger::Listener EnvironmentLogLevelListener::GetLogListener()
static Logger::Listener const consoleLogger = [](auto level, auto message) {
std::cerr << '['
<< Azure::Core::DateTime(std::chrono::system_clock::now())
<< Azure::DateTime(std::chrono::system_clock::now())
.ToString(
DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits)
<< "] " << LogLevelToConsoleString(level) << " : " << message << std::endl;

View File

@ -8,7 +8,7 @@
#include <chrono>
#include <limits>
using namespace Azure::Core;
using namespace Azure;
TEST(DateTime, ParseDateAndTimeBasic)
{

View File

@ -31,7 +31,7 @@ TEST(SimplifiedHeader, core)
EXPECT_NO_THROW(Azure::Core::CaseInsensitiveMap imap);
EXPECT_NO_THROW(Azure::Core::CaseInsensitiveSet iset);
EXPECT_NO_THROW(Azure::Core::Context c);
EXPECT_NO_THROW(Azure::Core::DateTime(2020, 11, 03, 15, 30, 44));
EXPECT_NO_THROW(Azure::DateTime(2020, 11, 03, 15, 30, 44));
EXPECT_NO_THROW(Azure::ETag e);
EXPECT_NO_THROW(Azure::Core::Base64Decode("foo"));
EXPECT_NO_THROW(Azure::Core::Cryptography::Md5Hash m);

View File

@ -25,9 +25,9 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Common { n
* @param unixTime The number of seconds since 1970.
* @return Calculated Datetime.
*/
static inline Azure::Core::DateTime UnixTimeToDatetime(uint64_t unixTime)
static inline Azure::DateTime UnixTimeToDatetime(uint64_t unixTime)
{
return Azure::Core::DateTime(1970) + std::chrono::seconds(unixTime);
return Azure::DateTime(1970) + std::chrono::seconds(unixTime);
}
};
}}}}} // namespace Azure::Security::KeyVault::Common::_internal

View File

@ -45,13 +45,13 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys {
* @brief Indicate when the key was deleted.
*
*/
Azure::Core::DateTime DeletedDate;
Azure::DateTime DeletedDate;
/**
* @brief Indicate when the deleted key will be purged.
*
*/
Azure::Core::DateTime ScheduledPurgeDate;
Azure::DateTime ScheduledPurgeDate;
};
/*********************** Deserializer / Serializer ******************************/

View File

@ -39,13 +39,13 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys {
* @brief Indicates when the key will be valid and can be used for cryptographic operations.
*
*/
Azure::Core::Nullable<Azure::Core::DateTime> NotBefore;
Azure::Core::Nullable<Azure::DateTime> NotBefore;
/**
* @brief Indicates when the key will expire and cannot be used for cryptographic operations.
*
*/
Azure::Core::Nullable<Azure::Core::DateTime> ExpiresOn;
Azure::Core::Nullable<Azure::DateTime> ExpiresOn;
/**
* @brief whether the key is enabled and useable for cryptographic operations.

View File

@ -71,25 +71,25 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys {
* @brief Indicate when the key will be valid and can be used for cryptographic operations.
*
*/
Azure::Core::Nullable<Azure::Core::DateTime> NotBefore;
Azure::Core::Nullable<Azure::DateTime> NotBefore;
/**
* @brief Indicate when the key will expire and cannot be used for cryptographic operations.
*
*/
Azure::Core::Nullable<Azure::Core::DateTime> ExpiresOn;
Azure::Core::Nullable<Azure::DateTime> ExpiresOn;
/**
* @brief Indicate when the key was created.
*
*/
Azure::Core::Nullable<Azure::Core::DateTime> CreatedOn;
Azure::Core::Nullable<Azure::DateTime> CreatedOn;
/**
* @brief Indicate when the key was updated.
*
*/
Azure::Core::Nullable<Azure::Core::DateTime> UpdatedOn;
Azure::Core::Nullable<Azure::DateTime> UpdatedOn;
/**
* @brief The number of days a key is retained before being deleted for a soft delete-enabled

View File

@ -193,7 +193,7 @@ namespace Azure { namespace Storage { namespace Blobs {
* @brief Start time for the key's validity. The time should be specified in UTC, and
* will be truncated to second.
*/
Azure::Core::DateTime startsOn = std::chrono::system_clock::now();
Azure::DateTime startsOn = std::chrono::system_clock::now();
};
/**
@ -319,7 +319,7 @@ namespace Azure { namespace Storage { namespace Blobs {
* @brief Specify this header to perform the operation only if the resource has been
* modified since the specified time. This timestamp will be truncated to second.
*/
Azure::Core::Nullable<Azure::Core::DateTime> IfModifiedSince;
Azure::Core::Nullable<Azure::DateTime> IfModifiedSince;
} AccessConditions;
};

View File

@ -34,7 +34,7 @@ namespace Azure { namespace Storage { namespace Blobs {
{
std::string RequestId;
Azure::ETag ETag;
Azure::Core::DateTime LastModified;
Azure::DateTime LastModified;
std::string LeaseId;
};
@ -42,14 +42,14 @@ namespace Azure { namespace Storage { namespace Blobs {
{
std::string RequestId;
Azure::ETag ETag;
Azure::Core::DateTime LastModified;
Azure::DateTime LastModified;
};
struct ChangeBlobLeaseResult
{
std::string RequestId;
Azure::ETag ETag;
Azure::Core::DateTime LastModified;
Azure::DateTime LastModified;
std::string LeaseId;
};
@ -57,14 +57,14 @@ namespace Azure { namespace Storage { namespace Blobs {
{
std::string RequestId;
Azure::ETag ETag;
Azure::Core::DateTime LastModified;
Azure::DateTime LastModified;
};
struct RenewBlobLeaseResult
{
std::string RequestId;
Azure::ETag ETag;
Azure::Core::DateTime LastModified;
Azure::DateTime LastModified;
std::string LeaseId;
};
@ -74,7 +74,7 @@ namespace Azure { namespace Storage { namespace Blobs {
public:
std::string RequestId;
Azure::ETag ETag;
Azure::Core::DateTime LastModified;
Azure::DateTime LastModified;
std::string CopyId;
Models::CopyStatus CopyStatus;
Azure::Core::Nullable<std::string> VersionId;

View File

@ -184,14 +184,14 @@ namespace Azure { namespace Storage { namespace Sas {
* @brief Optionally specify the time at which the shared access signature becomes
* valid. This timestamp will be truncated to second.
*/
Azure::Core::Nullable<Azure::Core::DateTime> StartsOn;
Azure::Core::Nullable<Azure::DateTime> StartsOn;
/**
* @brief The time at which the shared access signature becomes invalid. This field must
* be omitted if it has been specified in an associated stored access policy. This timestamp
* will be truncated to second.
*/
Azure::Core::DateTime ExpiresOn;
Azure::DateTime ExpiresOn;
/**
* @brief Specifies an IP address or a range of IP addresses from which to accept

View File

@ -112,7 +112,7 @@ namespace Azure { namespace Storage { namespace Blobs {
* @return A deserialized GetUserDelegationKeyResult instance.
*/
Azure::Response<Models::GetUserDelegationKeyResult> GetUserDelegationKey(
const Azure::Core::DateTime& expiresOn,
const Azure::DateTime& expiresOn,
const GetUserDelegationKeyOptions& options = GetUserDelegationKeyOptions(),
const Azure::Core::Context& context = Azure::Core::Context()) const;

View File

@ -128,14 +128,14 @@ namespace Azure { namespace Storage { namespace Sas {
snapshotVersion = BlobVersionId;
}
std::string startsOnStr = StartsOn.HasValue() ? StartsOn.GetValue().ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Azure::Core::DateTime::TimeFractionFormat::Truncate)
: "";
std::string expiresOnStr = Identifier.empty() ? ExpiresOn.ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Azure::Core::DateTime::TimeFractionFormat::Truncate)
: "";
std::string startsOnStr = StartsOn.HasValue()
? StartsOn.GetValue().ToString(
Azure::DateTime::DateFormat::Rfc3339, Azure::DateTime::TimeFractionFormat::Truncate)
: "";
std::string expiresOnStr = Identifier.empty()
? ExpiresOn.ToString(
Azure::DateTime::DateFormat::Rfc3339, Azure::DateTime::TimeFractionFormat::Truncate)
: "";
std::string stringToSign = Permissions + "\n" + startsOnStr + "\n" + expiresOnStr + "\n"
+ canonicalName + "\n" + Identifier + "\n" + (IPRange.HasValue() ? IPRange.GetValue() : "")
@ -224,19 +224,16 @@ namespace Azure { namespace Storage { namespace Sas {
snapshotVersion = BlobVersionId;
}
std::string startsOnStr = StartsOn.HasValue() ? StartsOn.GetValue().ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Azure::Core::DateTime::TimeFractionFormat::Truncate)
: "";
std::string startsOnStr = StartsOn.HasValue()
? StartsOn.GetValue().ToString(
Azure::DateTime::DateFormat::Rfc3339, Azure::DateTime::TimeFractionFormat::Truncate)
: "";
std::string expiresOnStr = ExpiresOn.ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Azure::Core::DateTime::TimeFractionFormat::Truncate);
Azure::DateTime::DateFormat::Rfc3339, Azure::DateTime::TimeFractionFormat::Truncate);
std::string signedStartsOnStr = userDelegationKey.SignedStartsOn.ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Azure::Core::DateTime::TimeFractionFormat::Truncate);
Azure::DateTime::DateFormat::Rfc3339, Azure::DateTime::TimeFractionFormat::Truncate);
std::string signedExpiresOnStr = userDelegationKey.SignedExpiresOn.ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Azure::Core::DateTime::TimeFractionFormat::Truncate);
Azure::DateTime::DateFormat::Rfc3339, Azure::DateTime::TimeFractionFormat::Truncate);
std::string stringToSign = Permissions + "\n" + startsOnStr + "\n" + expiresOnStr + "\n"
+ canonicalName + "\n" + userDelegationKey.SignedObjectId + "\n"

View File

@ -148,7 +148,7 @@ namespace Azure { namespace Storage { namespace Blobs {
}
Azure::Response<Models::GetUserDelegationKeyResult> BlobServiceClient::GetUserDelegationKey(
const Azure::Core::DateTime& expiresOn,
const Azure::DateTime& expiresOn,
const GetUserDelegationKeyOptions& options,
const Azure::Core::Context& context) const
{

View File

@ -381,7 +381,7 @@ namespace Azure { namespace Storage { namespace Test {
Sas::BlobSasBuilder builder2 = blobSasBuilder;
builder2.StartsOn.Reset();
builder2.ExpiresOn = Azure::Core::DateTime();
builder2.ExpiresOn = Azure::DateTime();
builder2.SetPermissions(static_cast<Sas::BlobContainerSasPermissions>(0));
builder2.Identifier = identifier.Id;

View File

@ -152,7 +152,7 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_TRUE(IsValidTime(res->LastAccessedOn.GetValue()));
}
{
Azure::Core::DateTime lastAccessedOn;
Azure::DateTime lastAccessedOn;
Azure::Storage::Blobs::ListBlobsSinglePageOptions options;
options.Prefix = m_blobName;

View File

@ -90,8 +90,8 @@ namespace Azure { namespace Storage { namespace Test {
response->SetHeader("x-ms-error-code", "BlobNotFound");
response->SetHeader(
"date",
Azure::Core::DateTime(std::chrono::system_clock::now())
.ToString(Azure::Core::DateTime::DateFormat::Rfc1123));
Azure::DateTime(std::chrono::system_clock::now())
.ToString(Azure::DateTime::DateFormat::Rfc1123));
return response;
};
auto ConstructPreconditionFailedResponse = []() {
@ -115,8 +115,8 @@ namespace Azure { namespace Storage { namespace Test {
response->SetHeader("x-ms-error-code", "ConditionNotMet");
response->SetHeader(
"date",
Azure::Core::DateTime(std::chrono::system_clock::now())
.ToString(Azure::Core::DateTime::DateFormat::Rfc1123));
Azure::DateTime(std::chrono::system_clock::now())
.ToString(Azure::DateTime::DateFormat::Rfc1123));
return response;
};
auto ConstructPrimaryResponse
@ -145,8 +145,8 @@ namespace Azure { namespace Storage { namespace Test {
response->SetHeader("x-ms-server-encrypted", "true");
response->SetHeader(
"date",
Azure::Core::DateTime(std::chrono::system_clock::now())
.ToString(Azure::Core::DateTime::DateFormat::Rfc1123));
Azure::DateTime(std::chrono::system_clock::now())
.ToString(Azure::DateTime::DateFormat::Rfc1123));
return response;
};
auto ConstructSecondaryResponse =
@ -175,8 +175,8 @@ namespace Azure { namespace Storage { namespace Test {
response->SetHeader("x-ms-server-encrypted", "true");
response->SetHeader(
"date",
Azure::Core::DateTime(std::chrono::system_clock::now())
.ToString(Azure::Core::DateTime::DateFormat::Rfc1123));
Azure::DateTime(std::chrono::system_clock::now())
.ToString(Azure::DateTime::DateFormat::Rfc1123));
return response;
};

View File

@ -217,13 +217,13 @@ namespace Azure { namespace Storage { namespace Sas {
* @brief Optionally specify the time at which the shared access signature becomes
* valid.
*/
Azure::Core::Nullable<Azure::Core::DateTime> StartsOn;
Azure::Core::Nullable<Azure::DateTime> StartsOn;
/**
* @brief The time at which the shared access signature becomes invalid. This field must
* be omitted if it has been specified in an associated stored access policy.
*/
Azure::Core::DateTime ExpiresOn;
Azure::DateTime ExpiresOn;
/**
* @brief Specifies an IP address or a range of IP addresses from which to accept

View File

@ -91,13 +91,12 @@ namespace Azure { namespace Storage { namespace Sas {
resourceTypes += "o";
}
std::string startsOnStr = StartsOn.HasValue() ? StartsOn.GetValue().ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Azure::Core::DateTime::TimeFractionFormat::Truncate)
: "";
std::string startsOnStr = StartsOn.HasValue()
? StartsOn.GetValue().ToString(
Azure::DateTime::DateFormat::Rfc3339, Azure::DateTime::TimeFractionFormat::Truncate)
: "";
std::string expiresOnStr = ExpiresOn.ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Azure::Core::DateTime::TimeFractionFormat::Truncate);
Azure::DateTime::DateFormat::Rfc3339, Azure::DateTime::TimeFractionFormat::Truncate);
std::string stringToSign = credential.AccountName + "\n" + Permissions + "\n" + services + "\n"
+ resourceTypes + "\n" + startsOnStr + "\n" + expiresOnStr + "\n"

View File

@ -24,8 +24,8 @@ namespace Azure { namespace Storage { namespace _detail {
// add x-ms-date header in RFC1123 format
request.SetHeader(
HttpHeaderXMsDate,
Core::DateTime(std::chrono::system_clock::now())
.ToString(Azure::Core::DateTime::DateFormat::Rfc1123));
DateTime(std::chrono::system_clock::now())
.ToString(Azure::DateTime::DateFormat::Rfc1123));
}
return nextHttpPolicy.Send(request, ctx);

View File

@ -253,7 +253,7 @@ namespace Azure { namespace Storage { namespace Test {
return secondaryUri.GetAbsoluteUrl();
}
bool IsValidTime(const Azure::Core::DateTime& datetime)
bool IsValidTime(const Azure::DateTime& datetime)
{
// We assume datetime within a week is valid.
const auto minTime = std::chrono::system_clock::now() - std::chrono::hours(24 * 7);

View File

@ -82,7 +82,7 @@ namespace Azure { namespace Storage { namespace Test {
std::string InferSecondaryUrl(const std::string primaryUri);
bool IsValidTime(const Azure::Core::DateTime& datetime);
bool IsValidTime(const Azure::DateTime& datetime);
inline std::string Base64EncodeText(const std::string& text)
{

View File

@ -624,7 +624,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
* @brief The expiry time in RFC1123 format. Only work if ExpiryOrigin is
* ScheduleFileExpiryOriginType::Absolute.
*/
Azure::Core::Nullable<Core::DateTime> ExpiresOn;
Azure::Core::Nullable<DateTime> ExpiresOn;
};
using AcquireDataLakeLeaseOptions = Blobs::AcquireBlobLeaseOptions;

View File

@ -21,7 +21,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { nam
struct FileSystemItemDetails
{
Azure::ETag ETag;
Azure::Core::DateTime LastModified;
Azure::DateTime LastModified;
Storage::Metadata Metadata;
PublicAccessType AccessType = PublicAccessType::None;
bool HasImmutabilityPolicy = false;
@ -56,7 +56,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { nam
{
PublicAccessType AccessType = PublicAccessType::None;
Azure::ETag ETag;
Azure::Core::DateTime LastModified;
Azure::DateTime LastModified;
std::vector<DataLakeSignedIdentifier> SignedIdentifiers;
std::string RequestId;
}; // struct GetDataLakeFileSystemAccessPolicyResult
@ -66,7 +66,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { nam
struct GetDataLakeFileSystemPropertiesResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
Storage::Metadata Metadata;
std::string RequestId;
};
@ -75,7 +75,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { nam
{
bool Created = true;
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
};
@ -88,7 +88,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { nam
struct SetDataLakeFileSystemMetadataResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
};
@ -147,8 +147,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { nam
struct GetDataLakePathPropertiesResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
Core::DateTime CreatedOn;
DateTime LastModified;
DateTime CreatedOn;
int64_t FileSize = 0;
Storage::Metadata Metadata;
Azure::Core::Nullable<LeaseDurationType> LeaseDuration;
@ -158,14 +158,14 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { nam
Azure::Core::Nullable<bool> IsServerEncrypted;
Azure::Core::Nullable<std::vector<uint8_t>> EncryptionKeySha256;
Azure::Core::Nullable<bool> IsAccessTierInferred;
Azure::Core::Nullable<Core::DateTime> AccessTierChangedOn;
Azure::Core::Nullable<DateTime> AccessTierChangedOn;
Azure::Core::Nullable<std::string> CopyId;
Azure::Core::Nullable<std::string> CopySource;
Azure::Core::Nullable<Blobs::Models::CopyStatus> CopyStatus;
Azure::Core::Nullable<std::string> CopyProgress;
Azure::Core::Nullable<Core::DateTime> CopyCompletedOn;
Azure::Core::Nullable<Core::DateTime> ExpiresOn;
Azure::Core::Nullable<Core::DateTime> LastAccessedOn;
Azure::Core::Nullable<DateTime> CopyCompletedOn;
Azure::Core::Nullable<DateTime> ExpiresOn;
Azure::Core::Nullable<DateTime> LastAccessedOn;
bool IsDirectory = false;
Azure::Core::Nullable<DataLakeArchiveStatus> ArchiveStatus;
Azure::Core::Nullable<Models::RehydratePriority> RehydratePriority;
@ -180,7 +180,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { nam
struct GetDataLakePathAccessControlListResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string Owner;
std::string Group;
std::string Permissions;
@ -191,14 +191,14 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { nam
struct SetDataLakePathHttpHeadersResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
};
struct SetDataLakePathMetadataResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
};
@ -206,7 +206,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { nam
{
bool Created = true;
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
Azure::Core::Nullable<int64_t> FileSize;
std::string RequestId;
};
@ -225,21 +225,21 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { nam
struct DownloadDataLakeFileDetails
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
Azure::Core::Nullable<LeaseDurationType> LeaseDuration;
LeaseStateType LeaseState;
LeaseStatusType LeaseStatus;
PathHttpHeaders HttpHeaders;
Storage::Metadata Metadata;
Core::DateTime CreatedOn;
Azure::Core::Nullable<Core::DateTime> ExpiresOn;
Azure::Core::Nullable<Core::DateTime> LastAccessedOn;
DateTime CreatedOn;
Azure::Core::Nullable<DateTime> ExpiresOn;
Azure::Core::Nullable<DateTime> LastAccessedOn;
Azure::Core::Nullable<std::string> CopyId;
Azure::Core::Nullable<std::string> CopySource;
Azure::Core::Nullable<Models::CopyStatus> CopyStatus;
Azure::Core::Nullable<std::string> CopyStatusDescription;
Azure::Core::Nullable<std::string> CopyProgress;
Azure::Core::Nullable<Azure::Core::DateTime> CopyCompletedOn;
Azure::Core::Nullable<Azure::DateTime> CopyCompletedOn;
Azure::Core::Nullable<std::string> VersionId;
Azure::Core::Nullable<bool> IsCurrentVersion;
bool IsServerEncrypted = false;

View File

@ -188,14 +188,14 @@ namespace Azure { namespace Storage { namespace Sas {
* @brief Optionally specify the time at which the shared access signature becomes
* valid. This timestamp will be truncated to second.
*/
Azure::Core::Nullable<Azure::Core::DateTime> StartsOn;
Azure::Core::Nullable<Azure::DateTime> StartsOn;
/**
* @brief The time at which the shared access signature becomes invalid. This field must
* be omitted if it has been specified in an associated stored access policy. This timestamp
* will be truncated to second.
*/
Azure::Core::DateTime ExpiresOn;
Azure::DateTime ExpiresOn;
/**
* @brief Specifies an IP address or a range of IP addresses from which to accept

View File

@ -103,7 +103,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
* @remark This request is sent to blob endpoint.
*/
Azure::Response<Models::GetUserDelegationKeyResult> GetUserDelegationKey(
const Azure::Core::DateTime& expiresOn,
const Azure::DateTime& expiresOn,
const GetUserDelegationKeyOptions& options = GetUserDelegationKeyOptions(),
const Azure::Core::Context& context = Azure::Core::Context()) const
{

View File

@ -111,7 +111,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
{
std::string Name;
bool IsDirectory = bool();
Core::DateTime LastModified;
DateTime LastModified;
std::string ETag;
int64_t FileSize = int64_t();
std::string Owner;
@ -332,7 +332,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
struct PathCreateResult
{
Azure::ETag ETag;
Azure::Core::Nullable<Core::DateTime> LastModified;
Azure::Core::Nullable<DateTime> LastModified;
std::string RequestId;
Azure::Core::Nullable<int64_t> ContentLength;
};
@ -342,7 +342,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
Azure::Core::Nullable<std::string> AcceptRanges;
PathHttpHeaders HttpHeaders;
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
Azure::Core::Nullable<std::string> ResourceType;
Azure::Core::Nullable<std::string> Properties;
@ -364,7 +364,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
struct PathSetAccessControlResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
};
@ -381,7 +381,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
struct PathFlushDataResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
int64_t ContentLength = int64_t();
std::string RequestId;
};
@ -499,8 +499,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
{
result.IsDirectory = (node["isDirectory"].get<std::string>() == "true");
}
result.LastModified = Core::DateTime::Parse(
node["lastModified"].get<std::string>(), Core::DateTime::DateFormat::Rfc1123);
result.LastModified = DateTime::Parse(
node["lastModified"].get<std::string>(), DateTime::DateFormat::Rfc1123);
result.ETag = node["etag"].get<std::string>();
if (node.contains("contentLength"))
{
@ -553,12 +553,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
Azure::Core::Nullable<std::string> Umask;
Azure::ETag IfMatch;
Azure::ETag IfNoneMatch;
Azure::Core::Nullable<Core::DateTime> IfModifiedSince;
Azure::Core::Nullable<Core::DateTime> IfUnmodifiedSince;
Azure::Core::Nullable<DateTime> IfModifiedSince;
Azure::Core::Nullable<DateTime> IfUnmodifiedSince;
Azure::ETag SourceIfMatch;
Azure::ETag SourceIfNoneMatch;
Azure::Core::Nullable<Core::DateTime> SourceIfModifiedSince;
Azure::Core::Nullable<Core::DateTime> SourceIfUnmodifiedSince;
Azure::Core::Nullable<DateTime> SourceIfModifiedSince;
Azure::Core::Nullable<DateTime> SourceIfUnmodifiedSince;
};
static Azure::Response<PathCreateResult> Create(
@ -657,15 +657,13 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
{
request.SetHeader(
_detail::HeaderIfModifiedSince,
createOptions.IfModifiedSince.GetValue().ToString(
Core::DateTime::DateFormat::Rfc1123));
createOptions.IfModifiedSince.GetValue().ToString(DateTime::DateFormat::Rfc1123));
}
if (createOptions.IfUnmodifiedSince.HasValue())
{
request.SetHeader(
_detail::HeaderIfUnmodifiedSince,
createOptions.IfUnmodifiedSince.GetValue().ToString(
Core::DateTime::DateFormat::Rfc1123));
createOptions.IfUnmodifiedSince.GetValue().ToString(DateTime::DateFormat::Rfc1123));
}
if (createOptions.SourceIfMatch.HasValue())
{
@ -681,14 +679,14 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
request.SetHeader(
_detail::HeaderSourceIfModifiedSince,
createOptions.SourceIfModifiedSince.GetValue().ToString(
Core::DateTime::DateFormat::Rfc1123));
DateTime::DateFormat::Rfc1123));
}
if (createOptions.SourceIfUnmodifiedSince.HasValue())
{
request.SetHeader(
_detail::HeaderSourceIfUnmodifiedSince,
createOptions.SourceIfUnmodifiedSince.GetValue().ToString(
Core::DateTime::DateFormat::Rfc1123));
DateTime::DateFormat::Rfc1123));
}
return CreateParseResult(context, pipeline.Send(request, context));
}
@ -702,8 +700,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
Azure::Core::Nullable<std::string> LeaseIdOptional;
Azure::ETag IfMatch;
Azure::ETag IfNoneMatch;
Azure::Core::Nullable<Core::DateTime> IfModifiedSince;
Azure::Core::Nullable<Core::DateTime> IfUnmodifiedSince;
Azure::Core::Nullable<DateTime> IfModifiedSince;
Azure::Core::Nullable<DateTime> IfUnmodifiedSince;
};
static Azure::Response<PathGetPropertiesResult> GetProperties(
@ -754,14 +752,14 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
request.SetHeader(
_detail::HeaderIfModifiedSince,
getPropertiesOptions.IfModifiedSince.GetValue().ToString(
Core::DateTime::DateFormat::Rfc1123));
DateTime::DateFormat::Rfc1123));
}
if (getPropertiesOptions.IfUnmodifiedSince.HasValue())
{
request.SetHeader(
_detail::HeaderIfUnmodifiedSince,
getPropertiesOptions.IfUnmodifiedSince.GetValue().ToString(
Core::DateTime::DateFormat::Rfc1123));
DateTime::DateFormat::Rfc1123));
}
return GetPropertiesParseResult(context, pipeline.Send(request, context));
}
@ -775,8 +773,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
Azure::Core::Nullable<std::string> LeaseIdOptional;
Azure::ETag IfMatch;
Azure::ETag IfNoneMatch;
Azure::Core::Nullable<Core::DateTime> IfModifiedSince;
Azure::Core::Nullable<Core::DateTime> IfUnmodifiedSince;
Azure::Core::Nullable<DateTime> IfModifiedSince;
Azure::Core::Nullable<DateTime> IfUnmodifiedSince;
};
static Azure::Response<PathDeleteResult> Delete(
@ -824,15 +822,13 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
{
request.SetHeader(
_detail::HeaderIfModifiedSince,
deleteOptions.IfModifiedSince.GetValue().ToString(
Core::DateTime::DateFormat::Rfc1123));
deleteOptions.IfModifiedSince.GetValue().ToString(DateTime::DateFormat::Rfc1123));
}
if (deleteOptions.IfUnmodifiedSince.HasValue())
{
request.SetHeader(
_detail::HeaderIfUnmodifiedSince,
deleteOptions.IfUnmodifiedSince.GetValue().ToString(
Core::DateTime::DateFormat::Rfc1123));
deleteOptions.IfUnmodifiedSince.GetValue().ToString(DateTime::DateFormat::Rfc1123));
}
return DeleteParseResult(context, pipeline.Send(request, context));
}
@ -847,8 +843,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
Azure::Core::Nullable<std::string> Acl;
Azure::ETag IfMatch;
Azure::ETag IfNoneMatch;
Azure::Core::Nullable<Core::DateTime> IfModifiedSince;
Azure::Core::Nullable<Core::DateTime> IfUnmodifiedSince;
Azure::Core::Nullable<DateTime> IfModifiedSince;
Azure::Core::Nullable<DateTime> IfUnmodifiedSince;
std::string ApiVersionParameter = _detail::DefaultServiceApiVersion;
};
@ -903,14 +899,14 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
request.SetHeader(
_detail::HeaderIfModifiedSince,
setAccessControlOptions.IfModifiedSince.GetValue().ToString(
Core::DateTime::DateFormat::Rfc1123));
DateTime::DateFormat::Rfc1123));
}
if (setAccessControlOptions.IfUnmodifiedSince.HasValue())
{
request.SetHeader(
_detail::HeaderIfUnmodifiedSince,
setAccessControlOptions.IfUnmodifiedSince.GetValue().ToString(
Core::DateTime::DateFormat::Rfc1123));
DateTime::DateFormat::Rfc1123));
}
request.SetHeader(_detail::HeaderVersion, setAccessControlOptions.ApiVersionParameter);
return SetAccessControlParseResult(context, pipeline.Send(request, context));
@ -992,8 +988,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
Azure::Core::Nullable<std::string> ContentLanguage;
Azure::ETag IfMatch;
Azure::ETag IfNoneMatch;
Azure::Core::Nullable<Core::DateTime> IfModifiedSince;
Azure::Core::Nullable<Core::DateTime> IfUnmodifiedSince;
Azure::Core::Nullable<DateTime> IfModifiedSince;
Azure::Core::Nullable<DateTime> IfUnmodifiedSince;
std::string ApiVersionParameter = _detail::DefaultServiceApiVersion;
};
@ -1086,14 +1082,14 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
request.SetHeader(
_detail::HeaderIfModifiedSince,
flushDataOptions.IfModifiedSince.GetValue().ToString(
Core::DateTime::DateFormat::Rfc1123));
DateTime::DateFormat::Rfc1123));
}
if (flushDataOptions.IfUnmodifiedSince.HasValue())
{
request.SetHeader(
_detail::HeaderIfUnmodifiedSince,
flushDataOptions.IfUnmodifiedSince.GetValue().ToString(
Core::DateTime::DateFormat::Rfc1123));
DateTime::DateFormat::Rfc1123));
}
request.SetHeader(_detail::HeaderVersion, flushDataOptions.ApiVersionParameter);
return FlushDataParseResult(context, pipeline.Send(request, context));
@ -1179,9 +1175,9 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
if (response.GetHeaders().find(_detail::HeaderLastModified)
!= response.GetHeaders().end())
{
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
}
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
if (response.GetHeaders().find(_detail::HeaderContentLength)
@ -1247,9 +1243,9 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
if (response.GetHeaders().find(_detail::HeaderLastModified)
!= response.GetHeaders().end())
{
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
}
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
if (response.GetHeaders().find(_detail::HeaderResourceType)
@ -1347,9 +1343,9 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
if (response.GetHeaders().find(_detail::HeaderLastModified)
!= response.GetHeaders().end())
{
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
}
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
return Azure::Response<PathSetAccessControlResult>(
@ -1444,9 +1440,9 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
if (response.GetHeaders().find(_detail::HeaderLastModified)
!= response.GetHeaders().end())
{
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
}
if (response.GetHeaders().find(_detail::HeaderContentLength)
!= response.GetHeaders().end())

View File

@ -390,7 +390,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
if (options.ExpiresOn.HasValue())
{
protocolLayerOptions.ExpiryTime
= options.ExpiresOn.GetValue().ToString(Azure::Core::DateTime::DateFormat::Rfc1123);
= options.ExpiresOn.GetValue().ToString(Azure::DateTime::DateFormat::Rfc1123);
}
else if (options.TimeToExpire.HasValue())
{

View File

@ -123,14 +123,14 @@ namespace Azure { namespace Storage { namespace Sas {
std::string protocol = _detail::SasProtocolToString(Protocol);
std::string resource = DataLakeSasResourceToString(Resource);
std::string startsOnStr = StartsOn.HasValue() ? StartsOn.GetValue().ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Azure::Core::DateTime::TimeFractionFormat::Truncate)
: "";
std::string expiresOnStr = Identifier.empty() ? ExpiresOn.ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Azure::Core::DateTime::TimeFractionFormat::Truncate)
: "";
std::string startsOnStr = StartsOn.HasValue()
? StartsOn.GetValue().ToString(
Azure::DateTime::DateFormat::Rfc3339, Azure::DateTime::TimeFractionFormat::Truncate)
: "";
std::string expiresOnStr = Identifier.empty()
? ExpiresOn.ToString(
Azure::DateTime::DateFormat::Rfc3339, Azure::DateTime::TimeFractionFormat::Truncate)
: "";
std::string stringToSign = Permissions + "\n" + startsOnStr + "\n" + expiresOnStr + "\n"
+ canonicalName + "\n" + Identifier + "\n" + (IPRange.HasValue() ? IPRange.GetValue() : "")
@ -208,19 +208,16 @@ namespace Azure { namespace Storage { namespace Sas {
std::string protocol = _detail::SasProtocolToString(Protocol);
std::string resource = DataLakeSasResourceToString(Resource);
std::string startsOnStr = StartsOn.HasValue() ? StartsOn.GetValue().ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Azure::Core::DateTime::TimeFractionFormat::Truncate)
: "";
std::string startsOnStr = StartsOn.HasValue()
? StartsOn.GetValue().ToString(
Azure::DateTime::DateFormat::Rfc3339, Azure::DateTime::TimeFractionFormat::Truncate)
: "";
std::string expiresOnStr = ExpiresOn.ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Azure::Core::DateTime::TimeFractionFormat::Truncate);
Azure::DateTime::DateFormat::Rfc3339, Azure::DateTime::TimeFractionFormat::Truncate);
std::string signedStartsOnStr = userDelegationKey.SignedStartsOn.ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Azure::Core::DateTime::TimeFractionFormat::Truncate);
Azure::DateTime::DateFormat::Rfc3339, Azure::DateTime::TimeFractionFormat::Truncate);
std::string signedExpiresOnStr = userDelegationKey.SignedExpiresOn.ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Azure::Core::DateTime::TimeFractionFormat::Truncate);
Azure::DateTime::DateFormat::Rfc3339, Azure::DateTime::TimeFractionFormat::Truncate);
std::string stringToSign = Permissions + "\n" + startsOnStr + "\n" + expiresOnStr + "\n"
+ canonicalName + "\n" + userDelegationKey.SignedObjectId + "\n"

View File

@ -447,8 +447,8 @@ namespace Azure { namespace Storage { namespace Test {
client.ScheduleDeletion(
Files::DataLake::ScheduleDataLakeFileExpiryOriginType::Absolute, options),
StorageException);
options.ExpiresOn = Azure::Core::DateTime::Parse(
"Wed, 29 Sep 2100 09:53:03 GMT", Azure::Core::DateTime::DateFormat::Rfc1123);
options.ExpiresOn = Azure::DateTime::Parse(
"Wed, 29 Sep 2100 09:53:03 GMT", Azure::DateTime::DateFormat::Rfc1123);
options.TimeToExpire = Azure::Core::Nullable<std::chrono::milliseconds>();
EXPECT_NO_THROW(client.ScheduleDeletion(
Files::DataLake::ScheduleDataLakeFileExpiryOriginType::Absolute, options));

View File

@ -173,7 +173,7 @@ namespace Azure { namespace Storage { namespace Test {
auto createResult = client.CreateIfNotExists();
EXPECT_FALSE(createResult->Created);
EXPECT_FALSE(createResult->ETag.HasValue());
EXPECT_EQ(Core::DateTime(), createResult->LastModified);
EXPECT_EQ(DateTime(), createResult->LastModified);
auto deleted = client.Delete()->Deleted;
EXPECT_TRUE(deleted);
}

View File

@ -396,7 +396,7 @@ namespace Azure { namespace Storage { namespace Test {
Sas::DataLakeSasBuilder builder2 = fileSasBuilder;
builder2.StartsOn.Reset();
builder2.ExpiresOn = Azure::Core::DateTime();
builder2.ExpiresOn = Azure::DateTime();
builder2.SetPermissions(static_cast<Sas::DataLakeFileSystemSasPermissions>(0));
builder2.Identifier = identifier.Id;

View File

@ -57,17 +57,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
/**
* @brief Creation time for the file/directory.
*/
Azure::Core::Nullable<Core::DateTime> CreatedOn;
Azure::Core::Nullable<DateTime> CreatedOn;
/**
* @brief Last write time for the file/directory.
*/
Azure::Core::Nullable<Core::DateTime> LastWrittenOn;
Azure::Core::Nullable<DateTime> LastWrittenOn;
/**
* @brief Changed time for the file/directory.
*/
Azure::Core::Nullable<Core::DateTime> ChangedOn;
Azure::Core::Nullable<DateTime> ChangedOn;
/**
* @brief The fileId of the file.
@ -158,8 +158,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// An Access policy.
struct AccessPolicy
{
Core::DateTime StartsOn; // The date-time the policy is active.
Core::DateTime ExpiresOn; // The date-time the policy expires.
DateTime StartsOn; // The date-time the policy is active.
DateTime ExpiresOn; // The date-time the policy expires.
std::string Permission; // The permissions for the ACL policy.
};
@ -217,9 +217,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
std::string ParentId; // ParentId uniquely identifies the parent directory of the object.
std::string SessionId; // SMB session ID in context of which the file handle was opened
std::string ClientIp; // Client IP that opened the handle
Core::DateTime OpenedOn; // Time when the session that previously opened the handle has last
// been reconnected. (UTC)
Core::DateTime LastReconnectedOn; // Time handle was last connected to (UTC)
DateTime OpenedOn; // Time when the session that previously opened the handle has last
// been reconnected. (UTC)
DateTime LastReconnectedOn; // Time handle was last connected to (UTC)
};
// When a file or share is leased, specifies whether the lease is of infinite or fixed duration.
@ -276,17 +276,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// Properties of a share.
struct ShareItemDetails
{
Core::DateTime LastModified;
DateTime LastModified;
Azure::ETag Etag;
int64_t Quota = int64_t();
Azure::Core::Nullable<int32_t> ProvisionedIops;
Azure::Core::Nullable<int32_t> ProvisionedIngressMBps;
Azure::Core::Nullable<int32_t> ProvisionedEgressMBps;
Azure::Core::Nullable<Core::DateTime> NextAllowedQuotaDowngradeTime;
Azure::Core::Nullable<Core::DateTime> DeletedOn;
Azure::Core::Nullable<DateTime> NextAllowedQuotaDowngradeTime;
Azure::Core::Nullable<DateTime> DeletedOn;
int32_t RemainingRetentionDays = int32_t();
Azure::Core::Nullable<ShareAccessTier> AccessTier; // The access tier of the share.
Azure::Core::Nullable<Core::DateTime> AccessTierChangedOn;
Azure::Core::Nullable<DateTime> AccessTierChangedOn;
Azure::Core::Nullable<std::string> AccessTierTransitionState;
LeaseStatusType LeaseStatus;
LeaseStateType LeaseState;
@ -682,7 +682,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct ShareCreateResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
};
@ -690,18 +690,18 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
Storage::Metadata Metadata;
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
int64_t Quota = int64_t();
Azure::Core::Nullable<int32_t> ProvisionedIops;
Azure::Core::Nullable<int32_t> ProvisionedIngressMBps;
Azure::Core::Nullable<int32_t> ProvisionedEgressMBps;
Azure::Core::Nullable<Core::DateTime> NextAllowedQuotaDowngradeTime;
Azure::Core::Nullable<DateTime> NextAllowedQuotaDowngradeTime;
Azure::Core::Nullable<LeaseDurationType> LeaseDuration;
Azure::Core::Nullable<LeaseStateType> LeaseState;
Azure::Core::Nullable<LeaseStatusType> LeaseStatus;
Azure::Core::Nullable<ShareAccessTier> AccessTier;
Azure::Core::Nullable<Core::DateTime> AccessTierChangedOn;
Azure::Core::Nullable<DateTime> AccessTierChangedOn;
Azure::Core::Nullable<std::string> AccessTierTransitionState;
};
@ -713,7 +713,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct ShareAcquireLeaseResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string LeaseId;
std::string RequestId;
};
@ -721,14 +721,14 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct ShareReleaseLeaseResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
};
struct ShareChangeLeaseResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string LeaseId;
std::string RequestId;
};
@ -736,7 +736,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct ShareRenewLeaseResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string LeaseId;
std::string RequestId;
};
@ -744,7 +744,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct ShareBreakLeaseResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
};
@ -752,7 +752,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
std::string Snapshot;
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
};
@ -771,14 +771,14 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct ShareSetPropertiesResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
};
struct ShareSetMetadataResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
};
@ -786,14 +786,14 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
std::vector<SignedIdentifier> SignedIdentifiers;
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
};
struct ShareSetAccessPolicyResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
};
@ -801,21 +801,21 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
int64_t ShareUsageInBytes = int64_t();
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
};
struct ShareRestoreResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
};
struct DirectoryCreateResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
bool IsServerEncrypted = bool();
FileSmbProperties SmbProperties;
@ -825,7 +825,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
Storage::Metadata Metadata;
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
bool IsServerEncrypted = bool();
FileSmbProperties SmbProperties;
@ -840,7 +840,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
Azure::ETag ETag;
std::string RequestId;
Core::DateTime LastModified;
DateTime LastModified;
bool IsServerEncrypted = bool();
FileSmbProperties SmbProperties;
};
@ -885,7 +885,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct FileCreateResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
bool IsServerEncrypted = bool();
FileSmbProperties SmbProperties;
@ -894,7 +894,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct FileDownloadResult
{
std::unique_ptr<Azure::Core::IO::BodyStream> BodyStream;
Core::DateTime LastModified;
DateTime LastModified;
Storage::Metadata Metadata;
FileHttpHeaders HttpHeaders;
Azure::Core::Http::Range ContentRange;
@ -903,7 +903,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
Azure::Core::Nullable<Storage::ContentHash> TransactionalContentHash;
std::string RequestId;
std::string AcceptRanges;
Azure::Core::Nullable<Core::DateTime> CopyCompletedOn;
Azure::Core::Nullable<DateTime> CopyCompletedOn;
Azure::Core::Nullable<std::string> CopyStatusDescription;
Azure::Core::Nullable<std::string> CopyId;
Azure::Core::Nullable<std::string> CopyProgress;
@ -918,13 +918,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct FileGetPropertiesResult
{
Core::DateTime LastModified;
DateTime LastModified;
Storage::Metadata Metadata;
int64_t FileSize = int64_t();
FileHttpHeaders HttpHeaders;
Azure::ETag ETag;
std::string RequestId;
Azure::Core::Nullable<Core::DateTime> CopyCompletedOn;
Azure::Core::Nullable<DateTime> CopyCompletedOn;
Azure::Core::Nullable<std::string> CopyStatusDescription;
Azure::Core::Nullable<std::string> CopyId;
Azure::Core::Nullable<std::string> CopyProgress;
@ -945,7 +945,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct FileSetHttpHeadersResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
bool IsServerEncrypted = bool();
FileSmbProperties SmbProperties;
@ -961,7 +961,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct FileAcquireLeaseResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string LeaseId;
std::string RequestId;
};
@ -969,14 +969,14 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct FileReleaseLeaseResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
};
struct FileChangeLeaseResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string LeaseId;
std::string RequestId;
};
@ -984,7 +984,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct FileBreakLeaseResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
Azure::Core::Nullable<std::string> LeaseId;
std::string RequestId;
};
@ -992,7 +992,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct FileUploadRangeResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
Storage::ContentHash TransactionalContentHash;
std::string RequestId;
bool IsServerEncrypted = bool();
@ -1001,7 +1001,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct FileUploadRangeFromUrlResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
Storage::ContentHash TransactionalContentHash;
std::string RequestId;
bool IsServerEncrypted = bool();
@ -1011,7 +1011,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
std::vector<Core::Http::Range> Ranges;
std::vector<Core::Http::Range> ClearRanges;
Core::DateTime LastModified;
DateTime LastModified;
Azure::ETag ETag;
int64_t FileSize = int64_t();
std::string RequestId;
@ -1020,7 +1020,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct FileStartCopyResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
std::string CopyId;
CopyStatusType CopyStatus;
@ -2230,7 +2230,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
else if (path.size() == 1 && path[0] == XmlTagName::AccessTierChangeTime)
{
result.AccessTierChangedOn
= Core::DateTime::Parse(node.Value, Core::DateTime::DateFormat::Rfc1123);
= DateTime::Parse(node.Value, DateTime::DateFormat::Rfc1123);
}
else if (path.size() == 1 && path[0] == XmlTagName::AccessTierTransitionState)
{
@ -2238,8 +2238,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else if (path.size() == 1 && path[0] == XmlTagName::DeletedTime)
{
result.DeletedOn
= Core::DateTime::Parse(node.Value, Core::DateTime::DateFormat::Rfc1123);
result.DeletedOn = DateTime::Parse(node.Value, DateTime::DateFormat::Rfc1123);
}
else if (path.size() == 1 && path[0] == XmlTagName::Etag)
{
@ -2247,13 +2246,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else if (path.size() == 1 && path[0] == XmlTagName::LastModified)
{
result.LastModified
= Core::DateTime::Parse(node.Value, Core::DateTime::DateFormat::Rfc1123);
result.LastModified = DateTime::Parse(node.Value, DateTime::DateFormat::Rfc1123);
}
else if (path.size() == 1 && path[0] == XmlTagName::NextAllowedQuotaDowngradeTime)
{
result.NextAllowedQuotaDowngradeTime
= Core::DateTime::Parse(node.Value, Core::DateTime::DateFormat::Rfc1123);
= DateTime::Parse(node.Value, DateTime::DateFormat::Rfc1123);
}
else if (path.size() == 1 && path[0] == XmlTagName::ProvisionedEgressMBps)
{
@ -3213,9 +3211,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// Success, Share created.
ShareCreateResult result;
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
return Azure::Response<ShareCreateResult>(std::move(result), std::move(responsePtr));
}
@ -3244,9 +3242,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
result.Metadata.emplace(i->first.substr(10), i->second);
}
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
result.Quota = std::stoll(response.GetHeaders().at(_detail::HeaderQuota));
if (response.GetHeaders().find(_detail::HeaderProvisionedIops)
@ -3270,9 +3268,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
if (response.GetHeaders().find(_detail::HeaderNextAllowedQuotaDowngradeTime)
!= response.GetHeaders().end())
{
result.NextAllowedQuotaDowngradeTime = Core::DateTime::Parse(
result.NextAllowedQuotaDowngradeTime = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderNextAllowedQuotaDowngradeTime),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
}
if (response.GetHeaders().find(_detail::HeaderLeaseDuration)
!= response.GetHeaders().end())
@ -3299,9 +3297,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
if (response.GetHeaders().find(_detail::HeaderAccessTierChangedOn)
!= response.GetHeaders().end())
{
result.AccessTierChangedOn = Core::DateTime::Parse(
result.AccessTierChangedOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderAccessTierChangedOn),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
}
if (response.GetHeaders().find(_detail::HeaderAccessTierTransitionState)
!= response.GetHeaders().end())
@ -3348,9 +3346,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// The Acquire operation completed successfully.
ShareAcquireLeaseResult result;
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.LeaseId = response.GetHeaders().at(_detail::HeaderLeaseId);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
return Azure::Response<ShareAcquireLeaseResult>(
@ -3373,9 +3371,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// The Release operation completed successfully.
ShareReleaseLeaseResult result;
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
return Azure::Response<ShareReleaseLeaseResult>(
std::move(result), std::move(responsePtr));
@ -3397,9 +3395,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// The Change operation completed successfully.
ShareChangeLeaseResult result;
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.LeaseId = response.GetHeaders().at(_detail::HeaderLeaseId);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
return Azure::Response<ShareChangeLeaseResult>(
@ -3422,9 +3420,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// The Renew operation completed successfully.
ShareRenewLeaseResult result;
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.LeaseId = response.GetHeaders().at(_detail::HeaderLeaseId);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
return Azure::Response<ShareRenewLeaseResult>(
@ -3447,9 +3445,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// The Break operation completed successfully.
ShareBreakLeaseResult result;
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
return Azure::Response<ShareBreakLeaseResult>(
std::move(result), std::move(responsePtr));
@ -3472,9 +3470,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
ShareCreateSnapshotResult result;
result.Snapshot = response.GetHeaders().at(_detail::HeaderSnapshot);
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
return Azure::Response<ShareCreateSnapshotResult>(
std::move(result), std::move(responsePtr));
@ -3564,9 +3562,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// Success
ShareSetPropertiesResult result;
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
return Azure::Response<ShareSetPropertiesResult>(
std::move(result), std::move(responsePtr));
@ -3588,9 +3586,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// Success
ShareSetMetadataResult result;
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
return Azure::Response<ShareSetMetadataResult>(
std::move(result), std::move(responsePtr));
@ -3617,9 +3615,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
? ShareGetAccessPolicyResult()
: ShareGetAccessPolicyResultFromSignedIdentifiers(SignedIdentifiersFromXml(reader));
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
return Azure::Response<ShareGetAccessPolicyResult>(
std::move(result), std::move(responsePtr));
@ -3685,8 +3683,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
if (path.size() == 1 && path[0] == XmlTagName::Expiry)
{
result.ExpiresOn
= Core::DateTime::Parse(node.Value, Core::DateTime::DateFormat::Rfc3339);
result.ExpiresOn = DateTime::Parse(node.Value, DateTime::DateFormat::Rfc3339);
}
else if (path.size() == 1 && path[0] == XmlTagName::Permission)
{
@ -3694,8 +3691,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else if (path.size() == 1 && path[0] == XmlTagName::Start)
{
result.StartsOn
= Core::DateTime::Parse(node.Value, Core::DateTime::DateFormat::Rfc3339);
result.StartsOn = DateTime::Parse(node.Value, DateTime::DateFormat::Rfc3339);
}
}
}
@ -3842,9 +3838,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// Success.
ShareSetAccessPolicyResult result;
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
return Azure::Response<ShareSetAccessPolicyResult>(
std::move(result), std::move(responsePtr));
@ -3868,8 +3864,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
nullptr,
object.StartsOn
.ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Core::DateTime::TimeFractionFormat::AllDigits)
Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits)
.data()});
writer.Write(Storage::_detail::XmlNode{Storage::_detail::XmlNodeType::EndTag});
writer.Write(
@ -3879,8 +3874,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
nullptr,
object.ExpiresOn
.ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Core::DateTime::TimeFractionFormat::AllDigits)
Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits)
.data()});
writer.Write(Storage::_detail::XmlNode{Storage::_detail::XmlNodeType::EndTag});
writer.Write(
@ -3932,9 +3926,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
? ShareGetStatisticsResult()
: ShareGetStatisticsResultFromShareStats(ShareStatsFromXml(reader));
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
return Azure::Response<ShareGetStatisticsResult>(
std::move(result), std::move(responsePtr));
@ -4020,9 +4014,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// Created
ShareRestoreResult result;
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
return Azure::Response<ShareRestoreResult>(std::move(result), std::move(responsePtr));
}
@ -4402,9 +4396,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// Success, Directory created.
DirectoryCreateResult result;
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
result.IsServerEncrypted
= response.GetHeaders().at(_detail::HeaderRequestIsServerEncrypted) == "true";
@ -4412,15 +4406,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
= response.GetHeaders().at(_detail::HeaderFilePermissionKey);
result.SmbProperties.Attributes
= FileAttributes(response.GetHeaders().at(_detail::HeaderAttributes));
result.SmbProperties.CreatedOn = Core::DateTime::Parse(
response.GetHeaders().at(_detail::HeaderCreatedOn),
Core::DateTime::DateFormat::Rfc3339);
result.SmbProperties.LastWrittenOn = Core::DateTime::Parse(
result.SmbProperties.CreatedOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderCreatedOn), DateTime::DateFormat::Rfc3339);
result.SmbProperties.LastWrittenOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastWrittenOn),
Core::DateTime::DateFormat::Rfc3339);
result.SmbProperties.ChangedOn = Core::DateTime::Parse(
response.GetHeaders().at(_detail::HeaderChangedOn),
Core::DateTime::DateFormat::Rfc3339);
DateTime::DateFormat::Rfc3339);
result.SmbProperties.ChangedOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderChangedOn), DateTime::DateFormat::Rfc3339);
result.SmbProperties.FileId = response.GetHeaders().at(_detail::HeaderFileId);
result.SmbProperties.ParentFileId
= response.GetHeaders().at(_detail::HeaderParentFileId);
@ -4452,23 +4444,21 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
result.Metadata.emplace(i->first.substr(10), i->second);
}
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
result.IsServerEncrypted
= response.GetHeaders().at(_detail::HeaderIsServerEncrypted) == "true";
result.SmbProperties.Attributes
= FileAttributes(response.GetHeaders().at(_detail::HeaderAttributes));
result.SmbProperties.CreatedOn = Core::DateTime::Parse(
response.GetHeaders().at(_detail::HeaderCreatedOn),
Core::DateTime::DateFormat::Rfc3339);
result.SmbProperties.LastWrittenOn = Core::DateTime::Parse(
result.SmbProperties.CreatedOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderCreatedOn), DateTime::DateFormat::Rfc3339);
result.SmbProperties.LastWrittenOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastWrittenOn),
Core::DateTime::DateFormat::Rfc3339);
result.SmbProperties.ChangedOn = Core::DateTime::Parse(
response.GetHeaders().at(_detail::HeaderChangedOn),
Core::DateTime::DateFormat::Rfc3339);
DateTime::DateFormat::Rfc3339);
result.SmbProperties.ChangedOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderChangedOn), DateTime::DateFormat::Rfc3339);
result.SmbProperties.PermissionKey
= response.GetHeaders().at(_detail::HeaderFilePermissionKey);
result.SmbProperties.FileId = response.GetHeaders().at(_detail::HeaderFileId);
@ -4515,24 +4505,22 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
DirectorySetPropertiesResult result;
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.IsServerEncrypted
= response.GetHeaders().at(_detail::HeaderRequestIsServerEncrypted) == "true";
result.SmbProperties.PermissionKey
= response.GetHeaders().at(_detail::HeaderFilePermissionKey);
result.SmbProperties.Attributes
= FileAttributes(response.GetHeaders().at(_detail::HeaderAttributes));
result.SmbProperties.CreatedOn = Core::DateTime::Parse(
response.GetHeaders().at(_detail::HeaderCreatedOn),
Core::DateTime::DateFormat::Rfc3339);
result.SmbProperties.LastWrittenOn = Core::DateTime::Parse(
result.SmbProperties.CreatedOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderCreatedOn), DateTime::DateFormat::Rfc3339);
result.SmbProperties.LastWrittenOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastWrittenOn),
Core::DateTime::DateFormat::Rfc3339);
result.SmbProperties.ChangedOn = Core::DateTime::Parse(
response.GetHeaders().at(_detail::HeaderChangedOn),
Core::DateTime::DateFormat::Rfc3339);
DateTime::DateFormat::Rfc3339);
result.SmbProperties.ChangedOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderChangedOn), DateTime::DateFormat::Rfc3339);
result.SmbProperties.FileId = response.GetHeaders().at(_detail::HeaderFileId);
result.SmbProperties.ParentFileId
= response.GetHeaders().at(_detail::HeaderParentFileId);
@ -5077,12 +5065,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
else if (path.size() == 1 && path[0] == XmlTagName::LastReconnectTime)
{
result.LastReconnectedOn
= Core::DateTime::Parse(node.Value, Core::DateTime::DateFormat::Rfc1123);
= DateTime::Parse(node.Value, DateTime::DateFormat::Rfc1123);
}
else if (path.size() == 1 && path[0] == XmlTagName::OpenTime)
{
result.OpenedOn
= Core::DateTime::Parse(node.Value, Core::DateTime::DateFormat::Rfc1123);
result.OpenedOn = DateTime::Parse(node.Value, DateTime::DateFormat::Rfc1123);
}
else if (path.size() == 1 && path[0] == XmlTagName::ParentId)
{
@ -6090,9 +6077,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// Success, File created.
FileCreateResult result;
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
result.IsServerEncrypted
= response.GetHeaders().at(_detail::HeaderRequestIsServerEncrypted) == "true";
@ -6100,15 +6087,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
= response.GetHeaders().at(_detail::HeaderFilePermissionKey);
result.SmbProperties.Attributes
= FileAttributes(response.GetHeaders().at(_detail::HeaderAttributes));
result.SmbProperties.CreatedOn = Core::DateTime::Parse(
response.GetHeaders().at(_detail::HeaderCreatedOn),
Core::DateTime::DateFormat::Rfc3339);
result.SmbProperties.LastWrittenOn = Core::DateTime::Parse(
result.SmbProperties.CreatedOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderCreatedOn), DateTime::DateFormat::Rfc3339);
result.SmbProperties.LastWrittenOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastWrittenOn),
Core::DateTime::DateFormat::Rfc3339);
result.SmbProperties.ChangedOn = Core::DateTime::Parse(
response.GetHeaders().at(_detail::HeaderChangedOn),
Core::DateTime::DateFormat::Rfc3339);
DateTime::DateFormat::Rfc3339);
result.SmbProperties.ChangedOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderChangedOn), DateTime::DateFormat::Rfc3339);
result.SmbProperties.FileId = response.GetHeaders().at(_detail::HeaderFileId);
result.SmbProperties.ParentFileId
= response.GetHeaders().at(_detail::HeaderParentFileId);
@ -6131,9 +6116,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// Succeeded to read the entire file.
FileDownloadResult result;
result.BodyStream = response.GetBodyStream();
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
for (auto i = response.GetHeaders().lower_bound(_detail::HeaderMetadata);
i != response.GetHeaders().end()
@ -6210,9 +6195,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
if (response.GetHeaders().find(_detail::HeaderCopyCompletedOn)
!= response.GetHeaders().end())
{
result.CopyCompletedOn = Core::DateTime::Parse(
result.CopyCompletedOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderCopyCompletedOn),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
}
if (response.GetHeaders().find(_detail::HeaderCopyStatusDescription)
!= response.GetHeaders().end())
@ -6254,15 +6239,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
result.SmbProperties.Attributes
= FileAttributes(response.GetHeaders().at(_detail::HeaderAttributes));
result.SmbProperties.CreatedOn = Core::DateTime::Parse(
response.GetHeaders().at(_detail::HeaderCreatedOn),
Core::DateTime::DateFormat::Rfc3339);
result.SmbProperties.LastWrittenOn = Core::DateTime::Parse(
result.SmbProperties.CreatedOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderCreatedOn), DateTime::DateFormat::Rfc3339);
result.SmbProperties.LastWrittenOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastWrittenOn),
Core::DateTime::DateFormat::Rfc3339);
result.SmbProperties.ChangedOn = Core::DateTime::Parse(
response.GetHeaders().at(_detail::HeaderChangedOn),
Core::DateTime::DateFormat::Rfc3339);
DateTime::DateFormat::Rfc3339);
result.SmbProperties.ChangedOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderChangedOn), DateTime::DateFormat::Rfc3339);
result.SmbProperties.PermissionKey
= response.GetHeaders().at(_detail::HeaderFilePermissionKey);
result.SmbProperties.FileId = response.GetHeaders().at(_detail::HeaderFileId);
@ -6293,9 +6276,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// Succeeded to read a specified range of the file.
FileDownloadResult result;
result.BodyStream = response.GetBodyStream();
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
for (auto i = response.GetHeaders().lower_bound(_detail::HeaderMetadata);
i != response.GetHeaders().end()
@ -6372,9 +6355,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
if (response.GetHeaders().find(_detail::HeaderCopyCompletedOn)
!= response.GetHeaders().end())
{
result.CopyCompletedOn = Core::DateTime::Parse(
result.CopyCompletedOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderCopyCompletedOn),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
}
if (response.GetHeaders().find(_detail::HeaderCopyStatusDescription)
!= response.GetHeaders().end())
@ -6416,15 +6399,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
result.SmbProperties.Attributes
= FileAttributes(response.GetHeaders().at(_detail::HeaderAttributes));
result.SmbProperties.CreatedOn = Core::DateTime::Parse(
response.GetHeaders().at(_detail::HeaderCreatedOn),
Core::DateTime::DateFormat::Rfc3339);
result.SmbProperties.LastWrittenOn = Core::DateTime::Parse(
result.SmbProperties.CreatedOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderCreatedOn), DateTime::DateFormat::Rfc3339);
result.SmbProperties.LastWrittenOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastWrittenOn),
Core::DateTime::DateFormat::Rfc3339);
result.SmbProperties.ChangedOn = Core::DateTime::Parse(
response.GetHeaders().at(_detail::HeaderChangedOn),
Core::DateTime::DateFormat::Rfc3339);
DateTime::DateFormat::Rfc3339);
result.SmbProperties.ChangedOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderChangedOn), DateTime::DateFormat::Rfc3339);
result.SmbProperties.PermissionKey
= response.GetHeaders().at(_detail::HeaderFilePermissionKey);
result.SmbProperties.FileId = response.GetHeaders().at(_detail::HeaderFileId);
@ -6466,9 +6447,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
// Success.
FileGetPropertiesResult result;
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
for (auto i = response.GetHeaders().lower_bound(_detail::HeaderMetadata);
i != response.GetHeaders().end()
@ -6519,9 +6500,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
if (response.GetHeaders().find(_detail::HeaderCopyCompletedOn)
!= response.GetHeaders().end())
{
result.CopyCompletedOn = Core::DateTime::Parse(
result.CopyCompletedOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderCopyCompletedOn),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
}
if (response.GetHeaders().find(_detail::HeaderCopyStatusDescription)
!= response.GetHeaders().end())
@ -6557,15 +6538,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
result.SmbProperties.Attributes
= FileAttributes(response.GetHeaders().at(_detail::HeaderAttributes));
result.SmbProperties.CreatedOn = Core::DateTime::Parse(
response.GetHeaders().at(_detail::HeaderCreatedOn),
Core::DateTime::DateFormat::Rfc3339);
result.SmbProperties.LastWrittenOn = Core::DateTime::Parse(
result.SmbProperties.CreatedOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderCreatedOn), DateTime::DateFormat::Rfc3339);
result.SmbProperties.LastWrittenOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastWrittenOn),
Core::DateTime::DateFormat::Rfc3339);
result.SmbProperties.ChangedOn = Core::DateTime::Parse(
response.GetHeaders().at(_detail::HeaderChangedOn),
Core::DateTime::DateFormat::Rfc3339);
DateTime::DateFormat::Rfc3339);
result.SmbProperties.ChangedOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderChangedOn), DateTime::DateFormat::Rfc3339);
result.SmbProperties.PermissionKey
= response.GetHeaders().at(_detail::HeaderFilePermissionKey);
result.SmbProperties.FileId = response.GetHeaders().at(_detail::HeaderFileId);
@ -6628,9 +6607,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// Success
FileSetHttpHeadersResult result;
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
result.IsServerEncrypted
= response.GetHeaders().at(_detail::HeaderRequestIsServerEncrypted) == "true";
@ -6638,15 +6617,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
= response.GetHeaders().at(_detail::HeaderFilePermissionKey);
result.SmbProperties.Attributes
= FileAttributes(response.GetHeaders().at(_detail::HeaderAttributes));
result.SmbProperties.CreatedOn = Core::DateTime::Parse(
response.GetHeaders().at(_detail::HeaderCreatedOn),
Core::DateTime::DateFormat::Rfc3339);
result.SmbProperties.LastWrittenOn = Core::DateTime::Parse(
result.SmbProperties.CreatedOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderCreatedOn), DateTime::DateFormat::Rfc3339);
result.SmbProperties.LastWrittenOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastWrittenOn),
Core::DateTime::DateFormat::Rfc3339);
result.SmbProperties.ChangedOn = Core::DateTime::Parse(
response.GetHeaders().at(_detail::HeaderChangedOn),
Core::DateTime::DateFormat::Rfc3339);
DateTime::DateFormat::Rfc3339);
result.SmbProperties.ChangedOn = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderChangedOn), DateTime::DateFormat::Rfc3339);
result.SmbProperties.FileId = response.GetHeaders().at(_detail::HeaderFileId);
result.SmbProperties.ParentFileId
= response.GetHeaders().at(_detail::HeaderParentFileId);
@ -6693,9 +6670,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// The Acquire operation completed successfully.
FileAcquireLeaseResult result;
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.LeaseId = response.GetHeaders().at(_detail::HeaderLeaseId);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
return Azure::Response<FileAcquireLeaseResult>(
@ -6718,9 +6695,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// The Release operation completed successfully.
FileReleaseLeaseResult result;
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
return Azure::Response<FileReleaseLeaseResult>(
std::move(result), std::move(responsePtr));
@ -6742,9 +6719,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// The Change operation completed successfully.
FileChangeLeaseResult result;
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.LeaseId = response.GetHeaders().at(_detail::HeaderLeaseId);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
return Azure::Response<FileChangeLeaseResult>(
@ -6767,9 +6744,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// The Break operation completed successfully.
FileBreakLeaseResult result;
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
if (response.GetHeaders().find(_detail::HeaderLeaseId) != response.GetHeaders().end())
{
result.LeaseId = response.GetHeaders().at(_detail::HeaderLeaseId);
@ -6794,9 +6771,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// Success (Created).
FileUploadRangeResult result;
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
if (response.GetHeaders().find(_detail::HeaderTransactionalContentHashMd5)
!= response.GetHeaders().end())
{
@ -6831,9 +6808,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// Success (Created).
FileUploadRangeFromUrlResult result;
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.TransactionalContentHash = Storage::_detail::FromBase64String(
response.GetHeaders().at(_detail::HeaderTransactionalContentHashCrc64),
HashAlgorithm::Crc64);
@ -6864,9 +6841,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
FileGetRangeListResult result = bodyBuffer.empty()
? FileGetRangeListResult()
: FileGetRangeListResultFromShareFileRangeList(ShareFileRangeListFromXml(reader));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.FileSize = std::stoll(response.GetHeaders().at(_detail::HeaderXMsContentLength));
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
@ -6968,9 +6945,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// The copy file has been accepted with the specified copy status.
FileStartCopyResult result;
result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag));
result.LastModified = Core::DateTime::Parse(
result.LastModified = DateTime::Parse(
response.GetHeaders().at(_detail::HeaderLastModified),
Core::DateTime::DateFormat::Rfc1123);
DateTime::DateFormat::Rfc1123);
result.RequestId = response.GetHeaders().at(_detail::HeaderRequestId);
if (response.GetHeaders().find(_detail::HeaderCopyId) != response.GetHeaders().end())
{
@ -7128,12 +7105,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
else if (path.size() == 1 && path[0] == XmlTagName::LastReconnectTime)
{
result.LastReconnectedOn
= Core::DateTime::Parse(node.Value, Core::DateTime::DateFormat::Rfc1123);
= DateTime::Parse(node.Value, DateTime::DateFormat::Rfc1123);
}
else if (path.size() == 1 && path[0] == XmlTagName::OpenTime)
{
result.OpenedOn
= Core::DateTime::Parse(node.Value, Core::DateTime::DateFormat::Rfc1123);
result.OpenedOn = DateTime::Parse(node.Value, DateTime::DateFormat::Rfc1123);
}
else if (path.size() == 1 && path[0] == XmlTagName::ParentId)
{

View File

@ -25,7 +25,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
bool Created = true;
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
};
@ -54,7 +54,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct CreateShareDirectoryResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
bool IsServerEncrypted = bool();
FileSmbProperties SmbProperties;
@ -105,7 +105,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
bool Created = true;
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
bool IsServerEncrypted = bool();
FileSmbProperties SmbProperties;
std::string RequestId;
@ -119,10 +119,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct DownloadShareFileDetails
{
Core::DateTime LastModified;
DateTime LastModified;
Storage::Metadata Metadata;
Azure::ETag ETag;
Azure::Core::Nullable<Core::DateTime> CopyCompletedOn;
Azure::Core::Nullable<DateTime> CopyCompletedOn;
Azure::Core::Nullable<std::string> CopyStatusDescription;
Azure::Core::Nullable<std::string> CopyId;
Azure::Core::Nullable<std::string> CopyProgress;
@ -156,7 +156,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct ClearShareFileRangeResult
{
Azure::ETag ETag;
Core::DateTime LastModified;
DateTime LastModified;
std::string RequestId;
bool IsServerEncrypted = bool();
};
@ -190,7 +190,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
public:
std::string RequestId;
Azure::ETag ETag;
Azure::Core::DateTime LastModified;
Azure::DateTime LastModified;
std::string CopyId;
Models::CopyStatusType CopyStatus;
Azure::Core::Nullable<std::string> VersionId;

View File

@ -137,14 +137,14 @@ namespace Azure { namespace Storage { namespace Sas {
* @brief Optionally specify the time at which the shared access signature becomes
* valid. This timestamp will be truncated to second.
*/
Azure::Core::Nullable<Azure::Core::DateTime> StartsOn;
Azure::Core::Nullable<Azure::DateTime> StartsOn;
/**
* @brief The time at which the shared access signature becomes invalid. This field must
* be omitted if it has been specified in an associated stored access policy. This timestamp
* will be truncated to second.
*/
Azure::Core::DateTime ExpiresOn;
Azure::DateTime ExpiresOn;
/**
* @brief Specifies an IP address or a range of IP addresses from which to accept

View File

@ -133,8 +133,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
if (options.SmbProperties.CreatedOn.HasValue())
{
protocolLayerOptions.FileCreationTime = options.SmbProperties.CreatedOn.GetValue().ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Core::DateTime::TimeFractionFormat::AllDigits);
Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits);
}
else
{
@ -144,8 +143,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
protocolLayerOptions.FileLastWriteTime
= options.SmbProperties.LastWrittenOn.GetValue().ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Core::DateTime::TimeFractionFormat::AllDigits);
Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits);
}
else
{
@ -257,8 +255,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
if (smbProperties.CreatedOn.HasValue())
{
protocolLayerOptions.FileCreationTime = smbProperties.CreatedOn.GetValue().ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Core::DateTime::TimeFractionFormat::AllDigits);
Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits);
}
else
{
@ -267,8 +264,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
if (smbProperties.LastWrittenOn.HasValue())
{
protocolLayerOptions.FileLastWriteTime = smbProperties.LastWrittenOn.GetValue().ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Core::DateTime::TimeFractionFormat::AllDigits);
Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits);
}
else
{

View File

@ -122,8 +122,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
if (options.SmbProperties.CreatedOn.HasValue())
{
protocolLayerOptions.FileCreationTime = options.SmbProperties.CreatedOn.GetValue().ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Core::DateTime::TimeFractionFormat::AllDigits);
Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits);
}
else
{
@ -133,8 +132,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
protocolLayerOptions.FileLastWriteTime
= options.SmbProperties.LastWrittenOn.GetValue().ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Core::DateTime::TimeFractionFormat::AllDigits);
Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits);
}
else
{
@ -339,8 +337,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
protocolLayerOptions.FileCopyFileCreationTime
= options.SmbProperties.CreatedOn.GetValue().ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Core::DateTime::TimeFractionFormat::AllDigits);
Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits);
}
else
{
@ -350,8 +347,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
protocolLayerOptions.FileCopyFileLastWriteTime
= options.SmbProperties.LastWrittenOn.GetValue().ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Core::DateTime::TimeFractionFormat::AllDigits);
Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits);
}
else
{
@ -436,8 +432,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
if (smbProperties.CreatedOn.HasValue())
{
protocolLayerOptions.FileCreationTime = smbProperties.CreatedOn.GetValue().ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Core::DateTime::TimeFractionFormat::AllDigits);
Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits);
}
else
{
@ -446,8 +441,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
if (smbProperties.LastWrittenOn.HasValue())
{
protocolLayerOptions.FileLastWriteTime = smbProperties.LastWrittenOn.GetValue().ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Core::DateTime::TimeFractionFormat::AllDigits);
Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits);
}
else
{
@ -862,8 +856,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
if (options.SmbProperties.CreatedOn.HasValue())
{
protocolLayerOptions.FileCreationTime = options.SmbProperties.CreatedOn.GetValue().ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Core::DateTime::TimeFractionFormat::AllDigits);
Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits);
}
else
{
@ -873,8 +866,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
protocolLayerOptions.FileLastWriteTime
= options.SmbProperties.LastWrittenOn.GetValue().ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Core::DateTime::TimeFractionFormat::AllDigits);
Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits);
}
else
{
@ -968,8 +960,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
if (options.SmbProperties.CreatedOn.HasValue())
{
protocolLayerOptions.FileCreationTime = options.SmbProperties.CreatedOn.GetValue().ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Core::DateTime::TimeFractionFormat::AllDigits);
Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits);
}
else
{
@ -979,8 +970,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
protocolLayerOptions.FileLastWriteTime
= options.SmbProperties.LastWrittenOn.GetValue().ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Core::DateTime::TimeFractionFormat::AllDigits);
Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits);
}
else
{

View File

@ -84,14 +84,14 @@ namespace Azure { namespace Storage { namespace Sas {
std::string protocol = _detail::SasProtocolToString(Protocol);
std::string resource = ShareSasResourceToString(Resource);
std::string startsOnStr = StartsOn.HasValue() ? StartsOn.GetValue().ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Azure::Core::DateTime::TimeFractionFormat::Truncate)
: "";
std::string expiresOnStr = Identifier.empty() ? ExpiresOn.ToString(
Azure::Core::DateTime::DateFormat::Rfc3339,
Azure::Core::DateTime::TimeFractionFormat::Truncate)
: "";
std::string startsOnStr = StartsOn.HasValue()
? StartsOn.GetValue().ToString(
Azure::DateTime::DateFormat::Rfc3339, Azure::DateTime::TimeFractionFormat::Truncate)
: "";
std::string expiresOnStr = Identifier.empty()
? ExpiresOn.ToString(
Azure::DateTime::DateFormat::Rfc3339, Azure::DateTime::TimeFractionFormat::Truncate)
: "";
std::string stringToSign = Permissions + "\n" + startsOnStr + "\n" + expiresOnStr + "\n"
+ canonicalName + "\n" + Identifier + "\n" + (IPRange.HasValue() ? IPRange.GetValue() : "")

View File

@ -98,7 +98,7 @@ namespace Azure { namespace Storage { namespace Test {
auto createResult = client.CreateIfNotExists();
EXPECT_FALSE(createResult->Created);
EXPECT_FALSE(createResult->ETag.HasValue());
EXPECT_EQ(Core::DateTime(), createResult->LastModified);
EXPECT_EQ(DateTime(), createResult->LastModified);
auto deleted = client.Delete()->Deleted;
EXPECT_TRUE(deleted);
}
@ -240,11 +240,11 @@ namespace Azure { namespace Storage { namespace Test {
// auto aLease = *leaseClient.Acquire(leaseDuration);
// EXPECT_FALSE(aLease.ETag.empty());
// EXPECT_NE(Azure::Core::DateTime(), aLease.LastModified);
// EXPECT_NE(Azure::DateTime(), aLease.LastModified);
// EXPECT_EQ(aLease.LeaseId, leaseId1);
// aLease = *leaseClient.Acquire(leaseDuration);
// EXPECT_FALSE(aLease.ETag.empty());
// EXPECT_NE(Azure::Core::DateTime(), aLease.LastModified);
// EXPECT_NE(Azure::DateTime(), aLease.LastModified);
// EXPECT_EQ(aLease.LeaseId, leaseId1);
// auto properties = *m_shareClient->GetProperties();
@ -255,19 +255,19 @@ namespace Azure { namespace Storage { namespace Test {
// auto rLease = *leaseClient.Renew();
// EXPECT_FALSE(rLease.ETag.empty());
// EXPECT_NE(Azure::Core::DateTime(), rLease.LastModified);
// EXPECT_NE(Azure::DateTime(), rLease.LastModified);
// EXPECT_EQ(rLease.LeaseId, leaseId1);
// std::string leaseId2 = CreateUniqueLeaseId();
// EXPECT_NE(leaseId1, leaseId2);
// auto cLease = *leaseClient.Change(leaseId2);
// EXPECT_FALSE(cLease.ETag.empty());
// EXPECT_NE(Azure::Core::DateTime(), cLease.LastModified);
// EXPECT_NE(Azure::DateTime(), cLease.LastModified);
// EXPECT_EQ(cLease.LeaseId, leaseId2);
// auto relLease = *leaseClient.Release();
// EXPECT_FALSE(relLease.ETag.empty());
// EXPECT_NE(Azure::Core::DateTime(), relLease.LastModified);
// EXPECT_NE(Azure::DateTime(), relLease.LastModified);
// leaseClient = Files::Shares::ShareLeaseClient(*m_shareClient, CreateUniqueLeaseId());
// aLease = *leaseClient.Acquire(Files::Shares::ShareLeaseClient::InfiniteLeaseDuration);
@ -276,7 +276,7 @@ namespace Azure { namespace Storage { namespace Test {
// Files::Shares::Models::LeaseDurationType::Infinite, properties.LeaseDuration.GetValue());
// auto brokenLease = *leaseClient.Break();
// EXPECT_FALSE(brokenLease.ETag.empty());
// EXPECT_NE(Azure::Core::DateTime(), brokenLease.LastModified);
// EXPECT_NE(Azure::DateTime(), brokenLease.LastModified);
// EXPECT_EQ(brokenLease.LeaseTime, 0);
// Files::Shares::BreakShareLeaseOptions options;
@ -293,11 +293,11 @@ namespace Azure { namespace Storage { namespace Test {
// auto shareSnapshotLeaseClient = Files::Shares::ShareLeaseClient(shareSnapshot, leaseId1);
// auto aLease = *shareSnapshotLeaseClient.Acquire(leaseDuration);
// EXPECT_FALSE(aLease.ETag.empty());
// EXPECT_NE(Azure::Core::DateTime(), aLease.LastModified);
// EXPECT_NE(Azure::DateTime(), aLease.LastModified);
// EXPECT_EQ(aLease.LeaseId, leaseId1);
// aLease = *shareSnapshotLeaseClient.Acquire(leaseDuration);
// EXPECT_FALSE(aLease.ETag.empty());
// EXPECT_NE(Azure::Core::DateTime(), aLease.LastModified);
// EXPECT_NE(Azure::DateTime(), aLease.LastModified);
// EXPECT_EQ(aLease.LeaseId, leaseId1);
// auto properties = *shareSnapshot.GetProperties();
@ -308,19 +308,19 @@ namespace Azure { namespace Storage { namespace Test {
// auto rLease = *shareSnapshotLeaseClient.Renew();
// EXPECT_FALSE(rLease.ETag.empty());
// EXPECT_NE(Azure::Core::DateTime(), rLease.LastModified);
// EXPECT_NE(Azure::DateTime(), rLease.LastModified);
// EXPECT_EQ(rLease.LeaseId, leaseId1);
// std::string leaseId2 = CreateUniqueLeaseId();
// EXPECT_NE(leaseId1, leaseId2);
// auto cLease = *shareSnapshotLeaseClient.Change(leaseId2);
// EXPECT_FALSE(cLease.ETag.empty());
// EXPECT_NE(Azure::Core::DateTime(), cLease.LastModified);
// EXPECT_NE(Azure::DateTime(), cLease.LastModified);
// EXPECT_EQ(cLease.LeaseId, leaseId2);
// auto relLease = *shareSnapshotLeaseClient.Release();
// EXPECT_FALSE(relLease.ETag.empty());
// EXPECT_NE(Azure::Core::DateTime(), relLease.LastModified);
// EXPECT_NE(Azure::DateTime(), relLease.LastModified);
// shareSnapshotLeaseClient
// = Files::Shares::ShareLeaseClient(shareSnapshot, CreateUniqueLeaseId());
@ -332,7 +332,7 @@ namespace Azure { namespace Storage { namespace Test {
// Files::Shares::Models::LeaseDurationType::Infinite, properties.LeaseDuration.GetValue());
// auto brokenLease = *shareSnapshotLeaseClient.Break();
// EXPECT_FALSE(brokenLease.ETag.empty());
// EXPECT_NE(Azure::Core::DateTime(), brokenLease.LastModified);
// EXPECT_NE(Azure::DateTime(), brokenLease.LastModified);
// EXPECT_EQ(brokenLease.LeaseTime, 0);
// Files::Shares::BreakShareLeaseOptions options;

View File

@ -126,7 +126,7 @@ namespace Azure { namespace Storage { namespace Test {
auto createResult = client.CreateIfNotExists();
EXPECT_FALSE(createResult->Created);
EXPECT_FALSE(createResult->ETag.HasValue());
EXPECT_EQ(Core::DateTime(), createResult->LastModified);
EXPECT_EQ(DateTime(), createResult->LastModified);
auto deleted = client.Delete()->Deleted;
EXPECT_TRUE(deleted);
}

View File

@ -180,7 +180,7 @@ namespace Azure { namespace Storage { namespace Test {
Sas::ShareSasBuilder builder2 = fileSasBuilder;
builder2.StartsOn.Reset();
builder2.ExpiresOn = Azure::Core::DateTime();
builder2.ExpiresOn = Azure::DateTime();
builder2.SetPermissions(static_cast<Sas::ShareSasPermissions>(0));
builder2.Identifier = identifier.Id;