# File.hpp

This File On Github
Ask A Question

API: latest
module: oatpp
#include "oatpp/core/data/resource/File.hpp"

# File

File. extends - oatpp::data::Resource.

namespace oatpp { namespace data { namespace resource { 
  class File : public Resource {}
}}}

# Methods

Return Type Name Summary
[none] File Multiple implementations:
  1. Default constructor.
  2. Constructor.
  3. Constructor.
std::shared_ptr<data::stream::OutputStream> openOutputStream Open output stream to a file.
std::shared_ptr<data::stream::InputStream> openInputStream Open input stream to a temporary file.
oatpp::String getInMemoryData Not applicable.
v_int64 getKnownSize Not applicable.
oatpp::String getLocation Get location where temporary data is stored.

# File::File

  1. Default constructor.
    File() = default
    
  2. Constructor.
    • @param fullFilename
    File(const oatpp::String& fullFilename)
    
  3. Constructor.
    • @param directory
    • @param filename
    File(const oatpp::String& directory, const oatpp::String& filename)
    

# File::openOutputStream

Open output stream to a file.
Note: stream also captures file-handle. The file object won't be deleted until the stream is deleted.

std::shared_ptr<data::stream::OutputStream> openOutputStream() override

# File::openInputStream

Open input stream to a temporary file.
Note: stream also captures file-handle. The file won't be deleted until the stream is deleted.

std::shared_ptr<data::stream::InputStream> openInputStream() override

# File::getInMemoryData

Not applicable.

  • @return - always returns nullptr.

oatpp::String getInMemoryData() override

# File::getKnownSize

Not applicable.

  • @return - always returns -1.

v_int64 getKnownSize() override

# File::getLocation

Get location where temporary data is stored.

  • @return - [oatpp::String](/api/latest/oatpp/core/Types/#string).

oatpp::String getLocation() override