@@ -25,6 +25,8 @@ namespace internal {
2525
2626extern const char kGsScheme [];
2727
28+ class StorageInternal ;
29+
2830// Class for managing paths for firebase storage.
2931// Storage paths are made up of a bucket, a path,
3032// and (optionally) an object, located at that path.
@@ -35,11 +37,11 @@ class StoragePath {
3537
3638 // Constructs a storage path, based on an input URL. The URL can either be
3739 // an HTTP[s] link, or a gs URI.
38- explicit StoragePath (const std::string& path);
40+ explicit StoragePath (StorageInternal *storage, const std::string& path);
3941
4042 // Constructs a storage path, based on raw strings for the bucket, path, and
4143 // object.
42- StoragePath (const std::string& bucket, const std::string& path,
44+ StoragePath (StorageInternal *storage, const std::string& bucket, const std::string& path,
4345 const std::string& object = " " );
4446
4547 // The bucket portion of this path.
@@ -60,14 +62,14 @@ class StoragePath {
6062 // in a path where bucket is "bucket", local_path is "path/otherchild/" and
6163 // object is an empty string.
6264 StoragePath GetChild (const std::string& path) const {
63- return StoragePath (bucket_, path_.GetChild (path));
65+ return StoragePath (storage_internal_, bucket_, path_.GetChild (path));
6466 }
6567
6668 // Returns the location one folder up from the current location. If the
6769 // path is at already at the root level, this returns the path unchanged.
6870 // The Object in the result is always set to empty.
6971 StoragePath GetParent () const {
70- return StoragePath (bucket_, path_.GetParent ());
72+ return StoragePath (storage_internal_, bucket_, path_.GetParent ());
7173 }
7274
7375 // Returns the path as a HTTP URL to the asset.
@@ -82,14 +84,16 @@ class StoragePath {
8284 private:
8385 static const char * const kSeparator ;
8486
85- StoragePath (const std::string& bucket, const Path& path)
86- : bucket_(bucket), path_(path) {}
87+ StoragePath (StorageInternal *storage, const std::string& bucket, const Path& path)
88+ : storage_internal_(storage), bucket_(bucket), path_(path) {}
8789
8890 void ConstructFromGsUri (const std::string& uri, int path_start);
8991 void ConstructFromHttpUrl (const std::string& url, int path_start);
9092
9193 std::string bucket_;
9294 Path path_;
95+ StorageInternal* storage_internal_;
96+
9397};
9498
9599} // namespace internal
0 commit comments