ipfs-chromium
generated_directory_listing.h
1 #ifndef IPFS_GENERATED_DIRECTORY_LISTING_H_
2 #define IPFS_GENERATED_DIRECTORY_LISTING_H_
3 
4 #include <string>
5 #include <string_view>
6 
7 namespace ipfs {
8 
13  public:
14 
19  explicit GeneratedDirectoryListing(std::string_view base_path);
20 
25  void AddEntry(std::string_view name);
26 
31  std::string const& Finish();
32 
33  private:
34  std::string html_;
35  std::string base_path_;
36 
37  void AddLink(std::string_view name, std::string_view path);
38 };
39 } // namespace ipfs
40 
41 #endif // IPFS_GENERATED_DIRECTORY_LISTING_H_
An index.html listing out a directory node's content.
Definition: generated_directory_listing.h:12
GeneratedDirectoryListing(std::string_view base_path)
Get the HTML preamble going.
Definition: generated_directory_listing.cc:6
std::string const & Finish()
Finish up all the HTML stuff at the end.
Definition: generated_directory_listing.cc:44
void AddEntry(std::string_view name)
Add an entry to the list.
Definition: generated_directory_listing.cc:28