AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::sina::File Class Reference

An object to help track locations of files in the file system. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/sina/core/File.hpp>

Public Member Functions

 File (std::string uri)
 Construct a new File. More...
 
 File (std::string uri, conduit::Node const &asNode)
 Construct a new File. More...
 
std::string const & getUri () const noexcept
 Get the File's URI. More...
 
std::string const & getMimeType () const noexcept
 Get the File's MIME type. More...
 
std::vector< std::string > const & getTags () const noexcept
 Get the File's tags. More...
 
void setMimeType (std::string mimeType)
 Set the File's MIME type. More...
 
void setTags (std::vector< std::string > tags)
 Set the File's tags. More...
 
conduit::Node toNode () const
 Convert this File to its conduit Node representation. More...
 

Detailed Description

An object to help track locations of files in the file system.

A File tracks the location (URI) and mimetype of a file on the file system, plus any tags. In the Sina schema, a File always belongs to a Record or one of Record's inheriting types.

Every File must have a URI, while mimetype and tags are optional.

axom::sina::File myFile{"/path/to/file.png"};
myFile.setMimeType("image/png");
axom::sina::File myOtherFile{"/path/to/other/file.txt"};
myOtherFile.setTags({"these","are","tags"});
myRecord->add(myFile);
myRecord->add(myOtherFile);
An object to help track locations of files in the file system.
Definition: File.hpp:47
void setTags(std::vector< std::string > tags)
Set the File's tags.
void setMimeType(std::string mimeType)
Set the File's MIME type.

Constructor & Destructor Documentation

◆ File() [1/2]

axom::sina::File::File ( std::string  uri)
explicit

Construct a new File.

Parameters
urithe location of the file

◆ File() [2/2]

axom::sina::File::File ( std::string  uri,
conduit::Node const &  asNode 
)

Construct a new File.

Parameters
urithe uri for a file
asNodethe Node representation of the file's additional info

Member Function Documentation

◆ getUri()

std::string const& axom::sina::File::getUri ( ) const
inlinenoexcept

Get the File's URI.

Returns
the URI

◆ getMimeType()

std::string const& axom::sina::File::getMimeType ( ) const
inlinenoexcept

Get the File's MIME type.

Returns
the MIME type

◆ getTags()

std::vector<std::string> const& axom::sina::File::getTags ( ) const
inlinenoexcept

Get the File's tags.

Returns
the tags

◆ setMimeType()

void axom::sina::File::setMimeType ( std::string  mimeType)

Set the File's MIME type.

Parameters
mimeTypethe MIME type

◆ setTags()

void axom::sina::File::setTags ( std::vector< std::string >  tags)

Set the File's tags.

Parameters
tagsthe File's tags

◆ toNode()

conduit::Node axom::sina::File::toNode ( ) const

Convert this File to its conduit Node representation.

Returns
the File in its Node representation

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