forked from Azure/azure-sdk-for-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Storage Transfer Manager: Job Engine Implementation (Azure#3742)
- Loading branch information
1 parent
b6f4266
commit ee206b6
Showing
36 changed files
with
2,740 additions
and
1,128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 0 additions & 29 deletions
29
sdk/storage/azure-storage-datamovement/inc/azure/storage/datamovement/directory_iterator.hpp
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
sdk/storage/azure-storage-datamovement/inc/azure/storage/datamovement/filesystem.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
#include <utility> | ||
#include <vector> | ||
|
||
namespace Azure { namespace Storage { namespace _internal { | ||
|
||
bool IsDirectory(const std::string& path); | ||
bool IsRegularFile(const std::string& path); | ||
bool PathExists(const std::string& path); | ||
void CreateDirectory(const std::string& path); | ||
void Rename(const std::string& oldPath, const std::string& newPath); | ||
void Remove(const std::string& path); | ||
int64_t GetFileSize(const std::string& path); | ||
|
||
class DirectoryIterator final { | ||
public: | ||
struct DirectoryEntry final | ||
{ | ||
std::string Name; | ||
bool IsDirectory = false; | ||
int64_t Size = -1; | ||
}; | ||
explicit DirectoryIterator(const std::string& rootDirectory); | ||
DirectoryIterator(const DirectoryIterator&) = delete; | ||
DirectoryIterator& operator=(const DirectoryIterator&) = delete; | ||
~DirectoryIterator(); | ||
|
||
DirectoryEntry Next(); | ||
|
||
private: | ||
std::string m_rootDirectory; | ||
void* m_directroyObject; | ||
}; | ||
|
||
class MemoryMap final { | ||
public: | ||
explicit MemoryMap(const std::string& filename); | ||
MemoryMap(const MemoryMap&) = delete; | ||
MemoryMap(MemoryMap&& other) noexcept { *this = std::move(other); } | ||
MemoryMap& operator=(const MemoryMap&) = delete; | ||
MemoryMap& operator=(MemoryMap&& other) noexcept; | ||
~MemoryMap(); | ||
|
||
void* Map(size_t offset, size_t size); | ||
|
||
private: | ||
void* m_fileHandle = nullptr; | ||
std::vector<std::pair<void*, size_t>> m_mapped; | ||
}; | ||
|
||
}}} // namespace Azure::Storage::_internal |
Oops, something went wrong.