Fishnet 2.0.1
Framework for Graph-Based Analysis of GIS Vector Data
Loading...
Searching...
No Matches
fishnet::Shapefile Class Reference

Shapefile handle implementation. More...

#include <Shapefile.hpp>

Inheritance diagram for fishnet::Shapefile:
Collaboration diagram for fishnet::Shapefile:

Public Member Functions

std::vector< std::filesystem::path > getAssociatedFiles () const
 
 Shapefile (const std::filesystem::path &path)
 
bool exists () const noexcept
 
 operator bool () const noexcept
 
bool remove () const noexcept override
 Removes the file from the filesystem.
 
GISFileType type () const noexcept override
 Returns the type of GISFile.
 
Shapefile & move (const std::filesystem::path &path)
 
Shapefile & move (const std::filesystem::path &rootPath, std::string filename)
 
Shapefile copy (const std::filesystem::path &path) const
 
Shapefile copy (const std::filesystem::path &rootPath, std::string filename) const
 
std::string toString () const noexcept
 
- Public Member Functions inherited from fishnet::AbstractVectorFile
 AbstractVectorFile (const std::filesystem::path &pathToFile)
 
 AbstractVectorFile (const std::string &pathName)
 
virtual ~AbstractVectorFile ()=default
 
AbstractVectorFile & move (const std::filesystem::path &newPath)
 
AbstractVectorFile copy (const std::filesystem::path &newPath) const
 
std::string toString () const noexcept
 
- Public Member Functions inherited from fishnet::AbstractGISFile
const std::filesystem::path & getPath () const noexcept
 
 operator bool () const noexcept
 
bool exists () const noexcept
 Tests if the GISFile exists on the filesystem.
 
bool supports (const std::filesystem::path &path) const noexcept
 Checks if the supplied path is supported by the concrete GISFile implementation.
 
void changeFilename (const std::string &filename) noexcept
 Modifies the path of the GISFile by changing the filename (extension is preserved).
 
void appendToFilename (const std::string &suffix) noexcept
 Appends a suffix to the filename / stem of the GISFile (extension is preserved).
 
virtual ~AbstractGISFile ()=default
 

Static Public Member Functions

static bool supportsExtension (const std::filesystem::path &path)
 
static bool isValid (const std::filesystem::path &path)
 

Static Public Attributes

static constexpr std::array< std::string, 5 > FILE_EXTENSIONS
 
static constexpr std::array< std::string, 4 > REQUIRED_FILES
 

Additional Inherited Members

- Protected Member Functions inherited from fishnet::AbstractGISFile
void supportsOrThrow (const std::filesystem::path &path) const
 
- Protected Attributes inherited from fishnet::AbstractGISFile
std::filesystem::path pathToFile
 

Detailed Description

Shapefile handle implementation.

Constructor & Destructor Documentation

◆ Shapefile()

fishnet::Shapefile::Shapefile ( const std::filesystem::path &  path)
inlineexplicit

Member Function Documentation

◆ copy() [1/2]

Shapefile fishnet::Shapefile::copy ( const std::filesystem::path &  path) const

◆ copy() [2/2]

Shapefile fishnet::Shapefile::copy ( const std::filesystem::path &  rootPath,
std::string  filename 
) const

◆ exists()

bool fishnet::Shapefile::exists ( ) const
inlinenoexcept

◆ getAssociatedFiles()

std::vector< fs::path > Shapefile::getAssociatedFiles ( ) const

◆ isValid()

static bool fishnet::Shapefile::isValid ( const std::filesystem::path &  path)
inlinestatic

◆ move() [1/2]

Shapefile & fishnet::Shapefile::move ( const std::filesystem::path &  path)

◆ move() [2/2]

Shapefile & fishnet::Shapefile::move ( const std::filesystem::path &  rootPath,
std::string  filename 
)

◆ operator bool()

fishnet::Shapefile::operator bool ( ) const
inlinenoexcept

◆ remove()

bool Shapefile::remove ( ) const
overridevirtualnoexcept

Removes the file from the filesystem.

Returns
true success
false error

Reimplemented from fishnet::AbstractVectorFile.

◆ supportsExtension()

static bool fishnet::Shapefile::supportsExtension ( const std::filesystem::path &  path)
inlinestatic

◆ toString()

std::string Shapefile::toString ( ) const
noexcept

◆ type()

GISFileType fishnet::Shapefile::type ( ) const
inlineoverridevirtualnoexcept

Returns the type of GISFile.

Returns
constexpr GISFileType

Reimplemented from fishnet::AbstractVectorFile.

Member Data Documentation

◆ FILE_EXTENSIONS

constexpr std::array<std::string,5> fishnet::Shapefile::FILE_EXTENSIONS
inlinestaticconstexpr
Initial value:
= {
".shp",".shx",".prj",".dbf",".cpg"
}

◆ REQUIRED_FILES

constexpr std::array<std::string,4> fishnet::Shapefile::REQUIRED_FILES
inlinestaticconstexpr
Initial value:
= {
".shp",".shx",".dbf",".prj"
}

The documentation for this class was generated from the following files: