Revert r734944 -- this one wasn't meant to go in.

git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@734973 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
Lukáš Lalinský 2007-11-10 16:05:18 +00:00
parent 7c4dfa9188
commit 7b0c053359
15 changed files with 1 additions and 208 deletions

View File

@ -119,17 +119,6 @@ FLAC::File::File(const char *file, ID3v2::FrameFactory *frameFactory,
read(readProperties, propertiesStyle);
}
#ifdef TAGLIB_UNICODE_FILENAMES
FLAC::File::File(const wchar_t *file, ID3v2::FrameFactory *frameFactory,
bool readProperties, Properties::ReadStyle propertiesStyle) :
TagLib::File(file)
{
d = new FilePrivate;
d->ID3v2FrameFactory = frameFactory;
read(readProperties, propertiesStyle);
}
#endif
FLAC::File::~File()
{
delete d;

View File

@ -88,20 +88,6 @@ namespace TagLib {
bool readProperties = true,
Properties::ReadStyle propertiesStyle = Properties::Average);
#ifdef TAGLIB_UNICODE_FILENAMES
/*!
* Contructs a FLAC file from \a file. If \a readProperties is true the
* file's audio properties will also be read using \a propertiesStyle. If
* false, \a propertiesStyle is ignored.
*
* If this file contains and ID3v2 tag the frames will be created using
* \a frameFactory.
*/
File(const wchar_t *file, ID3v2::FrameFactory *frameFactory,
bool readProperties = true,
Properties::ReadStyle propertiesStyle = Properties::Average);
#endif
/*!
* Destroys this instance of the File.
*/

View File

@ -100,15 +100,6 @@ MPC::File::File(const char *file, bool readProperties,
read(readProperties, propertiesStyle);
}
#ifdef TAGLIB_UNICODE_FILENAMES
MPC::File::File(const wchar_t *file, bool readProperties,
Properties::ReadStyle propertiesStyle) : TagLib::File(file)
{
d = new FilePrivate;
read(readProperties, propertiesStyle);
}
#endif
MPC::File::~File()
{
delete d;

View File

@ -88,16 +88,6 @@ namespace TagLib {
File(const char *file, bool readProperties = true,
Properties::ReadStyle propertiesStyle = Properties::Average);
#ifdef TAGLIB_UNICODE_FILENAMES
/*!
* Contructs an MPC file from \a file. If \a readProperties is true the
* file's audio properties will also be read using \a propertiesStyle. If
* false, \a propertiesStyle is ignored.
*/
File(const wchar_t *file, bool readProperties = true,
Properties::ReadStyle propertiesStyle = Properties::Average);
#endif
/*!
* Destroys this instance of the File.
*/

View File

@ -246,19 +246,6 @@ MPEG::File::File(const char *file, ID3v2::FrameFactory *frameFactory,
}
}
#ifdef TAGLIB_UNICODE_FILENAMES
MPEG::File::File(const wchar_t *file, ID3v2::FrameFactory *frameFactory,
bool readProperties, Properties::ReadStyle propertiesStyle) :
TagLib::File(file)
{
d = new FilePrivate(frameFactory);
if(isOpen()) {
d->tag = new MPEGTag(this);
read(readProperties, propertiesStyle);
}
}
#endif
MPEG::File::~File()
{
delete d;

View File

@ -91,18 +91,6 @@ namespace TagLib {
bool readProperties = true,
Properties::ReadStyle propertiesStyle = Properties::Average);
#ifdef TAGLIB_UNICODE_FILENAMES
/*!
* Contructs an MPEG file from \a file. If \a readProperties is true the
* file's audio properties will also be read using \a propertiesStyle. If
* false, \a propertiesStyle is ignored. The frames will be created using
* \a frameFactory.
*/
File(const wchar_t *file, ID3v2::FrameFactory *frameFactory,
bool readProperties = true,
Properties::ReadStyle propertiesStyle = Properties::Average);
#endif
/*!
* Destroys this instance of the File.
*/

View File

@ -75,15 +75,6 @@ Ogg::FLAC::File::File(const char *file, bool readProperties,
read(readProperties, propertiesStyle);
}
#ifdef TAGLIB_UNICODE_FILENAMES
Ogg::FLAC::File::File(const wchar_t *file, bool readProperties,
Properties::ReadStyle propertiesStyle) : Ogg::File(file)
{
d = new FilePrivate;
read(readProperties, propertiesStyle);
}
#endif
Ogg::FLAC::File::~File()
{
delete d;

View File

@ -71,16 +71,6 @@ namespace TagLib {
File(const char *file, bool readProperties = true,
Properties::ReadStyle propertiesStyle = Properties::Average);
#ifdef TAGLIB_UNICODE_FILENAMES
/*!
* Contructs an Ogg/FLAC file from \a file. If \a readProperties is true
* the file's audio properties will also be read using \a propertiesStyle.
* If false, \a propertiesStyle is ignored.
*/
File(const wchar_t *file, bool readProperties = true,
Properties::ReadStyle propertiesStyle = Properties::Average);
#endif
/*!
* Destroys this instance of the File.
*/

View File

@ -213,13 +213,6 @@ Ogg::File::File(const char *file) : TagLib::File(file)
d = new FilePrivate;
}
#ifdef TAGLIB_UNICODE_FILENAMES
Ogg::File::File(const wchar_t *file) : TagLib::File(file)
{
d = new FilePrivate;
}
#endif
////////////////////////////////////////////////////////////////////////////////
// private members
////////////////////////////////////////////////////////////////////////////////

View File

@ -92,19 +92,6 @@ namespace TagLib {
*/
File(const char *file);
#ifdef TAGLIB_UNICODE_FILENAMES
/*!
* Contructs an Ogg file from \a file. If \a readProperties is true the
* file's audio properties will also be read using \a propertiesStyle. If
* false, \a propertiesStyle is ignored.
*
* \note This constructor is protected since Ogg::File shouldn't be
* instantiated directly but rather should be used through the codec
* specific subclasses.
*/
File(const wchar_t *file);
#endif
private:
File(const File &);
File &operator=(const File &);

View File

@ -68,15 +68,6 @@ Vorbis::File::File(const char *file, bool readProperties,
read(readProperties, propertiesStyle);
}
#ifdef TAGLIB_UNICODE_FILENAMES
Vorbis::File::File(const wchar_t *file, bool readProperties,
Properties::ReadStyle propertiesStyle) : Ogg::File(file)
{
d = new FilePrivate;
read(readProperties, propertiesStyle);
}
#endif
Vorbis::File::~File()
{
delete d;

View File

@ -70,16 +70,6 @@ namespace TagLib {
File(const char *file, bool readProperties = true,
Properties::ReadStyle propertiesStyle = Properties::Average);
#ifdef TAGLIB_UNICODE_FILENAMES
/*!
* Contructs a Vorbis file from \a file. If \a readProperties is true the
* file's audio properties will also be read using \a propertiesStyle. If
* false, \a propertiesStyle is ignored.
*/
File(const wchar_t *file, bool readProperties = true,
Properties::ReadStyle propertiesStyle = Properties::Average);
#endif
/*!
* Destroys this instance of the File.
*/

View File

@ -30,10 +30,6 @@
#define TAGLIB_MINOR_VERSION 4
#define TAGLIB_PATCH_VERSION 0
#ifdef _WIN32
#define TAGLIB_UNICODE_FILENAMES 1
#endif
#include <string>
//! A namespace for all TagLib related classes and functions

View File

@ -45,15 +45,6 @@
# define W_OK 2
#endif
#ifdef TAGLIB_UNICODE_FILENAMES
# ifdef _WIN32
# include <wchar.h>
# include <windows.h>
# else
# error "Unicode filenames are not supported on this platform."
# endif
#endif
using namespace TagLib;
class File::FilePrivate
@ -62,9 +53,6 @@ public:
FilePrivate(const char *fileName) :
file(0),
name(fileName),
#ifdef TAGLIB_UNICODE_FILENAMES
wname(0),
#endif
readOnly(true),
valid(true),
size(0)
@ -73,16 +61,10 @@ public:
~FilePrivate()
{
free((void *)name);
#ifdef TAGLIB_UNICODE_FILENAMES
free((void *)wname);
#endif
}
FILE *file;
const char *name;
#ifdef TAGLIB_UNICODE_FILENAMES
const wchar_t *wname;
#endif
bool readOnly;
bool valid;
ulong size;
@ -105,45 +87,12 @@ File::File(const char *file)
if(d->file)
d->readOnly = false;
else
d->file = fopen(file, "rb");
d->file = fopen(file,"rb");
if(!d->file)
debug("Could not open file " + String(file));
}
#ifdef TAGLIB_UNICODE_FILENAMES
File::File(const wchar_t *file)
{
#ifdef _WIN32
d = new FilePrivate(0);
d->wname = _wcsdup(file);
if(GetVersion() < 0x80000000) {
d->file = _wfopen(file, L"rb+");
if(d->file)
d->readOnly = false;
else
d->file = _wfopen(file, L"rb");
}
else {
size_t size = wcslen(file) + 1;
d->name = (char *)malloc(size);
if(WideCharToMultiByte(CP_ACP, 0, file, -1, (CHAR*)d->name, size,
NULL, NULL) > 0) {
d->file = fopen(d->name, "rb+");
if(d->file)
d->readOnly = false;
else
d->file = fopen(d->name, "rb");
}
}
if(!d->file)
debug("Could not open file " + String(file, String::UTF16LE));
#endif
}
#endif
File::~File()
{
if(d->file)
@ -156,13 +105,6 @@ const char *File::name() const
return d->name;
}
#ifdef TAGLIB_UNICODE_FILENAMES
const wchar_t *File::unicodeName() const
{
return d->wname;
}
#endif
ByteVector File::readBlock(ulong length)
{
if(!d->file) {

View File

@ -69,13 +69,6 @@ namespace TagLib {
*/
const char *name() const;
#ifdef TAGLIB_UNICODE_FILENAMES
/*!
* Returns the file name in UTF-16.
*/
const wchar_t *unicodeName() const;
#endif
/*!
* Returns a pointer to this file's tag. This should be reimplemented in
* the concrete subclasses.
@ -232,17 +225,6 @@ namespace TagLib {
*/
File(const char *file);
#ifdef TAGLIB_UNICODE_FILENAMES
/*!
* Construct a File object and opens the \a file. \a file should be a
* be a null-terminated Unicode string in UTF-16.
*
* \note Constructor is protected since this class should only be
* instantiated through subclasses.
*/
File(const wchar_t *file);
#endif
/*!
* Marks the file as valid or invalid.
*