Change ContentLength to FileSize. (#2338)

Fixes https://github.com/Azure/azure-sdk-for-cpp/issues/2334

# Pull Request Checklist

Please leverage this checklist as a reminder to address commonly occurring feedback when submitting a pull request to make sure your PR can be reviewed quickly:

See the detailed list in the [contributing guide](https://github.com/Azure/azure-sdk-for-cpp/blob/master/CONTRIBUTING.md#pull-requests).

- [x] [C++ Guidelines](https://azure.github.io/azure-sdk/cpp_introduction.html)
- [x] Doxygen docs
- [x] Unit tests
- [x] No unwanted commits/changes
- [x] Descriptive title/description
  - [x] PR is single purpose
  - [x] Related issue listed
- [x] Comments in source
- [x] No typos
- [x] Update changelog
- [x] Not work-in-progress
- [x] External references or docs updated
- [x] Self review of PR done
- [x] Any breaking changes?
This commit is contained in:
Kan Tang 2021-05-21 00:08:23 -07:00 committed by GitHub
parent ce30cca1cb
commit be29d332c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 6 deletions

View File

@ -15,6 +15,7 @@
- Renamed `HasMorePages()` in paged response to `HasPage()`. - Renamed `HasMorePages()` in paged response to `HasPage()`.
- Default chunk size for concurrent upload was changed to nullable. - Default chunk size for concurrent upload was changed to nullable.
- `DataLakeLeaseClient::Change()` updates internal lease id. - `DataLakeLeaseClient::Change()` updates internal lease id.
- Renamed `ContentLength` in `FlushFileResult` to `FileSize`.
## 12.0.0-beta.10 (2021-04-16) ## 12.0.0-beta.10 (2021-04-16)

View File

@ -265,7 +265,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
/** /**
* The size of the resource in bytes. * The size of the resource in bytes.
*/ */
int64_t ContentLength = int64_t(); int64_t FileSize = int64_t();
}; };
/** /**
@ -1634,8 +1634,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
if (response.GetHeaders().find(_detail::HeaderContentLength) if (response.GetHeaders().find(_detail::HeaderContentLength)
!= response.GetHeaders().end()) != response.GetHeaders().end())
{ {
result.ContentLength result.FileSize = std::stoll(response.GetHeaders().at(_detail::HeaderContentLength));
= std::stoll(response.GetHeaders().at(_detail::HeaderContentLength));
} }
return Azure::Response<Models::FlushFileResult>( return Azure::Response<Models::FlushFileResult>(
std::move(result), std::move(responsePtr)); std::move(result), std::move(responsePtr));

View File

@ -15,6 +15,7 @@
- Renamed `HasMorePages()` in paged response to `HasPage()`. - Renamed `HasMorePages()` in paged response to `HasPage()`.
- `ShareLeaseClient::Change()` updates internal lease id. - `ShareLeaseClient::Change()` updates internal lease id.
- `ShareItem::ShareMetadata` was renamed to `ShareItem::Metadata`. - `ShareItem::ShareMetadata` was renamed to `ShareItem::Metadata`.
- Renamed `ContentLength` in `FileItemDetails` to `FileSize`.
## 12.0.0-beta.10 (2021-04-16) ## 12.0.0-beta.10 (2021-04-16)

View File

@ -251,7 +251,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
* handle is closed or the op-lock is broken. To retrieve current property values, call Get * handle is closed or the op-lock is broken. To retrieve current property values, call Get
* File Properties. * File Properties.
*/ */
int64_t ContentLength = int64_t(); int64_t FileSize = int64_t();
}; };
/** /**
@ -5805,7 +5805,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{ {
if (path.size() == 1 && path[0] == XmlTagName::ContentLength) if (path.size() == 1 && path[0] == XmlTagName::ContentLength)
{ {
result.ContentLength = std::stoll(node.Value); result.FileSize = std::stoll(node.Value);
} }
} }
} }

View File

@ -391,7 +391,7 @@ namespace Azure { namespace Storage { namespace Test {
result.first.end(), result.first.end(),
[&name](const Files::Shares::Models::FileItem& item) { return item.Name == name; }); [&name](const Files::Shares::Models::FileItem& item) { return item.Name == name; });
EXPECT_EQ(iter->Name, name); EXPECT_EQ(iter->Name, name);
EXPECT_EQ(1024, iter->Details.ContentLength); EXPECT_EQ(1024, iter->Details.FileSize);
EXPECT_NE(result.first.end(), iter); EXPECT_NE(result.first.end(), iter);
} }
for (const auto& name : directoryNameSetB) for (const auto& name : directoryNameSetB)