diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/apev2/item.h | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/apev2/item.h')
-rw-r--r-- | Src/apev2/item.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Src/apev2/item.h b/Src/apev2/item.h new file mode 100644 index 00000000..87ded0b1 --- /dev/null +++ b/Src/apev2/item.h @@ -0,0 +1,43 @@ +#ifndef NULLSOFT_APEV2_ITEM_H +#define NULLSOFT_APEV2_ITEM_H + +#include <bfc/platform/types.h> + +namespace APEv2 +{ +enum +{ + ITEM_KEY_COMPARE_CASE_INSENSITIVE = 0, + ITEM_KEY_COMPARE_CASE_SENSITIVE = 1, +}; +class Item +{ +public: + Item(); + ~Item(); + void Retain(); + void Release(); + + /* If successful, puts incremented data pointer in new_data, and new data size remaining in new_len */ + int Read(void *data, size_t len, void **new_data, size_t *new_len); + + int Encode(void *data, size_t len); + size_t EncodeSize(); + + bool IsReadOnly(); + bool IsString(); + bool KeyMatch(const char *key, int compare=ITEM_KEY_COMPARE_CASE_INSENSITIVE); + int Get(void **data, size_t *len); + int GetKey(const char **tag); + int Set(const void *data, size_t len, int dataType); + int SetKey(const char *tag); + +private: + size_t refCount; + uint32_t flags; + char *key; + void *value; + uint32_t len; +}; +} +#endif |