10#include <unordered_map>
40 void leftRotate(
Node* x)
65 void rightRotate(
Node* x)
90 void fixInsert(
Node* k)
142 void inorderHelper(
Node* node)
148 inorderHelper(node->
left);
150 if (metadataMap.empty())
153 "Error: No files found matching the inode or no metadata extracted.");
156 for (
const auto& pair : metadataMap)
159 songTree.addSong(
Song(node->
data, pair.second));
161 inorderHelper(node->
right);
170 NIL->left = NIL->right = NIL;
177 new_node->
left = NIL;
178 new_node->
right = NIL;
180 Node* parent =
nullptr;
181 Node* current = root;
183 while (current != NIL)
188 current = current->
left;
192 current = current->
right;
196 new_node->
parent = parent;
198 if (parent ==
nullptr)
202 else if (new_node->
data < parent->
data)
204 parent->
left = new_node;
208 parent->
right = new_node;
211 if (new_node->
parent ==
nullptr)
RedBlackTree()
Definition rbtree.hpp:166
void insert(ino_t data)
Definition rbtree.hpp:174
auto returnSongTree() -> SongTree
Definition rbtree.hpp:227
void printSongTree()
Definition rbtree.hpp:226
void inorderStoreMetadata()
Definition rbtree.hpp:225
Represents a hierarchical tree structure to store songs by artist, album, disc number,...
Definition songmap.hpp:90
A class for parsing metadata from audio files.
Definition taglib_parser.h:74
auto parseFromInode(ino_t inode, const std::string &directory) -> std::unordered_map< std::string, Metadata >
Parse metadata from files in a directory based on inode.
Definition taglib_parser.h:254
string DEBUG_LOG_PARSE
Definition rbtree.hpp:20
string DIRECTORY_FIELD
Definition rbtree.hpp:18
#define BLACK
Definition rbtree.hpp:16
#define RED
Definition rbtree.hpp:15
Node(ino_t data)
Definition rbtree.hpp:29
ino_t data
Definition rbtree.hpp:25
Node * left
Definition rbtree.hpp:27
Node * parent
Definition rbtree.hpp:27
char color
Definition rbtree.hpp:26
Node * right
Definition rbtree.hpp:27
Represents a song with associated metadata and inode.
Definition songmap.hpp:46
void sendErrMsg(std::string debugLogBoolStr, std::string errMsg)
Sends an error message based on the debug log setting.
Definition taglib_parser.h:122
#define PARENT_DBG
Definition toml_parser.hpp:25
#define PARENT_LIB_FIELD_DIR
Definition toml_parser.hpp:18
auto parseTOMLField(string parent, string field) -> string_view
Parses a string field from the TOML configuration.
Definition toml_parser.hpp:144
#define PARENT_DBG_FIELD_TAGLIB_PARSER_LOG
Definition toml_parser.hpp:26
#define PARENT_LIB
Macros for parent and field names used in the TOML configuration.
Definition toml_parser.hpp:16