Tag Parser
9.1.1
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
|
Go to the documentation of this file. 1 #ifndef TAG_PARSER_BASICFILEINFO_H
2 #define TAG_PARSER_BASICFILEINFO_H
6 #include <c++utilities/conversion/stringconversion.h>
7 #include <c++utilities/io/nativefilestream.h>
23 void open(
bool readOnly =
false);
24 void reopen(
bool readOnly =
false);
26 bool isReadOnly()
const;
29 CppUtilities::NativeFileStream &stream();
30 const CppUtilities::NativeFileStream &stream()
const;
33 const std::string &path()
const;
34 void setPath(
const std::string &path);
35 static std::string fileName(
const std::string &path,
bool cutExtension =
false);
36 std::string fileName(
bool cutExtension =
false)
const;
37 static std::string extension(
const std::string &path);
38 std::string extension()
const;
39 static std::string pathWithoutExtension(
const std::string &fullPath);
40 std::string pathWithoutExtension()
const;
41 static std::string containingDirectory(
const std::string &path);
42 std::string containingDirectory()
const;
43 static const char *pathForOpen(
const std::string &
url);
46 std::uint64_t size()
const;
47 void reportSizeChanged(std::uint64_t newSize);
48 void reportPathChanged(
const std::string &newPath);
51 virtual void invalidated();
55 CppUtilities::NativeFileStream m_file;
67 return m_file.is_open();
142 return CppUtilities::startsWith(
url,
"file:/") ?
url.data() + 6 :
url.data();
147 #endif // TAG_PARSER_BASICFILEINFO_H
static const char * pathForOpen(const std::string &url)
Returns removes the "file:/" prefix from url to be able to pass it to functions like open(),...
Contains all classes and functions of the TagInfo library.
constexpr const TAG_PARSER_EXPORT char * url()
void reportPathChanged(const std::string &newPath)
Call this function to report that the path changed.
bool isReadOnly() const
Indicates whether the last open()/reopen() call was read-only.
The BasicFileInfo class provides basic file information such as file name, extension,...
bool isOpen() const
Indicates whether a std::fstream is open for the current file.
void reportSizeChanged(std::uint64_t newSize)
Call this function to report that the size changed.
std::uint64_t size() const
Returns size of the current file in bytes.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
CppUtilities::NativeFileStream & stream()
Returns the std::fstream for the current instance.
const std::string & path() const
Returns the path of the current file.