Node in the directory tree representing either a file or a directory.
More...
#include <TreeNode.h>
|
| | TreeNode ()=default |
| |
| std::string | getMime () const |
| | Very basic MIME inference based on file extension.
|
| |
| std::string | path () const |
| | Computes the full path from the root to this node.
|
| |
| int | level () const |
| | Returns the nesting level from the root.
|
| |
|
| static void * | operator new (std::size_t size) |
| |
| static void | operator delete (void *ptr) |
| |
| static void | setMimeRules (const std::vector< std::pair< std::string, std::string > > &rules) |
| | Replace all MIME rules.
|
| |
| static void | addMimeRule (const std::string &ext, const std::string &mime) |
| | Add one MIME rule mapping extension -> MIME type.
|
| |
Node in the directory tree representing either a file or a directory.
◆ TreeNode()
| tiny_dlna::TreeNode::TreeNode |
( |
| ) |
|
|
default |
◆ addMimeRule()
| static void tiny_dlna::TreeNode::addMimeRule |
( |
const std::string & |
ext, |
|
|
const std::string & |
mime |
|
) |
| |
|
inlinestatic |
Add one MIME rule mapping extension -> MIME type.
◆ getMime()
| std::string tiny_dlna::TreeNode::getMime |
( |
| ) |
const |
|
inline |
Very basic MIME inference based on file extension.
- Returns
- A MIME type string for known audio formats, or empty string if unknown or directory.
◆ level()
| int tiny_dlna::TreeNode::level |
( |
| ) |
const |
|
inline |
Returns the nesting level from the root.
- Returns
- 0 for the root, otherwise number of parents to reach the root.
◆ operator delete()
| static void tiny_dlna::TreeNode::operator delete |
( |
void * |
ptr | ) |
|
|
inlinestatic |
◆ operator new()
| static void * tiny_dlna::TreeNode::operator new |
( |
std::size_t |
size | ) |
|
|
inlinestatic |
◆ path()
| std::string tiny_dlna::TreeNode::path |
( |
| ) |
const |
|
inline |
Computes the full path from the root to this node.
- Returns
- Path string where directory components are separated by '/'.
◆ setMimeRules()
| static void tiny_dlna::TreeNode::setMimeRules |
( |
const std::vector< std::pair< std::string, std::string > > & |
rules | ) |
|
|
inlinestatic |
Replace all MIME rules.
Extensions are matched case-insensitively against the file name and should include the leading dot (e.g. ".mp3"). If provided without a dot or with uppercase letters, they will be normalized.
◆ children
◆ file_name
◆ id
| uint32_t tiny_dlna::TreeNode::id = 0 |
◆ is_dir
| bool tiny_dlna::TreeNode::is_dir = false |
◆ is_expanded
| bool tiny_dlna::TreeNode::is_expanded = false |
◆ parent
| TreeNode* tiny_dlna::TreeNode::parent = nullptr |
◆ size
| uint32_t tiny_dlna::TreeNode::size = 0 |
The documentation for this class was generated from the following file: