Removed BlobPrefix struct, use std::string instead (#1508)
* blob prefix is std::vector<std::string> * changelog
This commit is contained in:
parent
d3996e7824
commit
836a8a591a
@ -23,6 +23,7 @@
|
||||
- `ListBlobsIncludeItem` was renamed to `ListBlobsIncludeFlags`.
|
||||
- Removed `TagValue` from `FilterBlobItem`, removed `Where` from `FindBlobsByTagsSinglePageResult`.
|
||||
- Type for ETag was changed to `Azure::Core::ETag`.
|
||||
- Removed `BlobPrefix` struct, use `std::string` instead.
|
||||
|
||||
## 12.0.0-beta.6 (2020-01-14)
|
||||
|
||||
|
||||
@ -198,11 +198,6 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
std::string m_value;
|
||||
}; // extensible enum BlobLeaseStatus
|
||||
|
||||
struct BlobPrefix
|
||||
{
|
||||
std::string Name;
|
||||
}; // struct BlobPrefix
|
||||
|
||||
struct BlobRetentionPolicy
|
||||
{
|
||||
bool IsEnabled = false;
|
||||
@ -1120,7 +1115,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
std::string Delimiter;
|
||||
Azure::Core::Nullable<std::string> ContinuationToken;
|
||||
std::vector<BlobItem> Items;
|
||||
std::vector<BlobPrefix> BlobPrefixes;
|
||||
std::vector<std::string> BlobPrefixes;
|
||||
}; // struct ListBlobsByHierarchySinglePageResult
|
||||
|
||||
struct ListBlobsSinglePageResult
|
||||
@ -4010,6 +4005,7 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
k_Blobs,
|
||||
k_Blob,
|
||||
k_BlobPrefix,
|
||||
k_Name,
|
||||
k_Unknown,
|
||||
};
|
||||
std::vector<XmlTagName> path;
|
||||
@ -4061,6 +4057,10 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
{
|
||||
path.emplace_back(XmlTagName::k_BlobPrefix);
|
||||
}
|
||||
else if (std::strcmp(node.Name, "Name") == 0)
|
||||
{
|
||||
path.emplace_back(XmlTagName::k_Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
path.emplace_back(XmlTagName::k_Unknown);
|
||||
@ -4071,13 +4071,6 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
ret.Items.emplace_back(BlobItemFromXml(reader));
|
||||
path.pop_back();
|
||||
}
|
||||
else if (
|
||||
path.size() == 3 && path[0] == XmlTagName::k_EnumerationResults
|
||||
&& path[1] == XmlTagName::k_Blobs && path[2] == XmlTagName::k_BlobPrefix)
|
||||
{
|
||||
ret.BlobPrefixes.emplace_back(BlobPrefixFromXml(reader));
|
||||
path.pop_back();
|
||||
}
|
||||
}
|
||||
else if (node.Type == Storage::Details::XmlNodeType::Text)
|
||||
{
|
||||
@ -4098,6 +4091,13 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
{
|
||||
ret.ContinuationToken = node.Value;
|
||||
}
|
||||
else if (
|
||||
path.size() == 4 && path[0] == XmlTagName::k_EnumerationResults
|
||||
&& path[1] == XmlTagName::k_Blobs && path[2] == XmlTagName::k_BlobPrefix
|
||||
&& path[3] == XmlTagName::k_Name)
|
||||
{
|
||||
ret.BlobPrefixes.emplace_back(node.Value);
|
||||
}
|
||||
}
|
||||
else if (node.Type == Storage::Details::XmlNodeType::Attribute)
|
||||
{
|
||||
@ -4571,55 +4571,6 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
return ret;
|
||||
}
|
||||
|
||||
static BlobPrefix BlobPrefixFromXml(Storage::Details::XmlReader& reader)
|
||||
{
|
||||
BlobPrefix ret;
|
||||
enum class XmlTagName
|
||||
{
|
||||
k_Name,
|
||||
k_Unknown,
|
||||
};
|
||||
std::vector<XmlTagName> path;
|
||||
while (true)
|
||||
{
|
||||
auto node = reader.Read();
|
||||
if (node.Type == Storage::Details::XmlNodeType::End)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if (node.Type == Storage::Details::XmlNodeType::EndTag)
|
||||
{
|
||||
if (path.size() > 0)
|
||||
{
|
||||
path.pop_back();
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (node.Type == Storage::Details::XmlNodeType::StartTag)
|
||||
{
|
||||
if (std::strcmp(node.Name, "Name") == 0)
|
||||
{
|
||||
path.emplace_back(XmlTagName::k_Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
path.emplace_back(XmlTagName::k_Unknown);
|
||||
}
|
||||
}
|
||||
else if (node.Type == Storage::Details::XmlNodeType::Text)
|
||||
{
|
||||
if (path.size() == 1 && path[0] == XmlTagName::k_Name)
|
||||
{
|
||||
ret.Name = node.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static BlobSignedIdentifier BlobSignedIdentifierFromXml(Storage::Details::XmlReader& reader)
|
||||
{
|
||||
BlobSignedIdentifier ret;
|
||||
|
||||
@ -265,9 +265,9 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
EXPECT_EQ(res->Delimiter, delimiter);
|
||||
EXPECT_EQ(res->Prefix, options.Prefix.GetValue());
|
||||
EXPECT_TRUE(res->Items.empty());
|
||||
for (const auto& i : res->BlobPrefixes)
|
||||
for (const auto& p : res->BlobPrefixes)
|
||||
{
|
||||
items.emplace(i.Name);
|
||||
items.emplace(p);
|
||||
}
|
||||
if (res->ContinuationToken.HasValue())
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user