Archived
1
0
This repository has been archived on 2024-10-17. You can view files and clone it, but cannot push or open issues or pull requests.
winamp/Src/replicant/nsid3v2/frame_utils.h

22 lines
826 B
C
Raw Permalink Normal View History

2024-09-24 12:54:57 +00:00
#pragma once
#include "foundation/types.h"
#include "nu/ByteReader.h"
#include "nx/nxstring.h"
/* updates str, data_len and str_cch */
int ParseDescription(const char *&str, size_t &data_len, size_t &str_cch);
int ParseDescription(const wchar_t *&str, size_t &data_len, size_t &str_cch, uint8_t &str_encoding);
struct ParsedString
{
uint8_t encoding; // 0 - iso-8859-1, 1 - UTF16LE, 2 - UTF16BE, 3 - UTF8
const void *data;
size_t byte_length;
};
int ParseNullTerminatedString(bytereader_t reader, uint8_t encoding, ParsedString &parsed);
int ParseFrameTerminatedString(bytereader_t reader, uint8_t encoding, ParsedString &parsed);
int NXStringCreateFromParsedString(nx_string_t *value, ParsedString &parsed, int text_flags);
bool DescriptionMatches(const ParsedString &parsed, const char *description, int text_flags);