Commit 574840c5 authored by Christian Persch's avatar Christian Persch

goo: Split GDir and GDirEntry out of gfile.h

This allows including gfile.h together with glib.h which has
a conflicting GDir type.

poppler/poppler#370
parent f2223e12
Pipeline #4166 passed with stage
in 6 minutes and 9 seconds
...@@ -582,6 +582,7 @@ if(ENABLE_XPDF_HEADERS) ...@@ -582,6 +582,7 @@ if(ENABLE_XPDF_HEADERS)
goo/GooString.h goo/GooString.h
goo/gtypes.h goo/gtypes.h
goo/gmem.h goo/gmem.h
goo/gdir.h
goo/gfile.h goo/gfile.h
goo/FixedPoint.h goo/FixedPoint.h
goo/ImgWriter.h goo/ImgWriter.h
......
//========================================================================
//
// gfile.h
//
// Miscellaneous file and directory name manipulation.
//
// Copyright 1996-2003 Glyph & Cog, LLC
//
//========================================================================
//========================================================================
//
// Modified under the Poppler project - http://poppler.freedesktop.org
//
// All changes made under the Poppler project to this file are licensed
// under GPL version 2 or later
//
// Copyright (C) 2006 Kristian Høgsberg <krh@redhat.com>
// Copyright (C) 2009, 2011, 2012, 2017, 2018 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2009 Kovid Goyal <kovid@kovidgoyal.net>
// Copyright (C) 2013 Adam Reichold <adamreichold@myopera.com>
// Copyright (C) 2013, 2017 Adrian Johnson <ajohnson@redneon.com>
// Copyright (C) 2014 Bogdan Cristea <cristeab@gmail.com>
// Copyright (C) 2014 Peter Breitenlohner <peb@mppmu.mpg.de>
// Copyright (C) 2017 Christoph Cullmann <cullmann@kde.org>
// Copyright (C) 2017 Thomas Freitag <Thomas.Freitag@alfa.de>
// Copyright (C) 2018 Mojca Miklavec <mojca@macports.org>
//
// To see a description of the changes please see the Changelog file that
// came with your tarball or type make ChangeLog if you are building from git
//
//========================================================================
#ifndef GDIR_H
#define GDIR_H
#include "poppler-config.h"
#include "gtypes.h"
class GooString;
//------------------------------------------------------------------------
// GDir and GDirEntry
//------------------------------------------------------------------------
class GDirEntry {
public:
GDirEntry(char *dirPath, char *nameA, GBool doStat);
~GDirEntry();
GooString *getName() { return name; }
GooString *getFullPath() { return fullPath; }
GBool isDir() { return dir; }
private:
GDirEntry(const GDirEntry &other);
GDirEntry& operator=(const GDirEntry &other);
GooString *name; // dir/file name
GooString *fullPath;
GBool dir; // is it a directory?
};
class GDir {
public:
GDir(char *name, GBool doStatA = gTrue);
~GDir();
GDirEntry *getNextEntry();
void rewind();
private:
GDir(const GDir &other);
GDir& operator=(const GDir &other);
GooString *path; // directory path
GBool doStat; // call stat() for each entry?
#if defined(_WIN32)
WIN32_FIND_DATAA ffd;
HANDLE hnd;
#elif defined(ACORN)
#elif defined(MACOS)
#else
DIR *dir; // the DIR structure from opendir()
#ifdef VMS
GBool needParent; // need to return an entry for [-]
#endif
#endif
};
#endif
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
#include <limits> #include <limits>
#include "GooString.h" #include "GooString.h"
#include "gfile.h" #include "gfile.h"
#include "gdir.h"
// Some systems don't define this, so just make it something reasonably // Some systems don't define this, so just make it something reasonably
// large. // large.
......
...@@ -171,53 +171,4 @@ private: ...@@ -171,53 +171,4 @@ private:
#endif // _WIN32 #endif // _WIN32
}; };
//------------------------------------------------------------------------
// GDir and GDirEntry
//------------------------------------------------------------------------
class GDirEntry {
public:
GDirEntry(char *dirPath, char *nameA, GBool doStat);
~GDirEntry();
GooString *getName() { return name; }
GooString *getFullPath() { return fullPath; }
GBool isDir() { return dir; }
private:
GDirEntry(const GDirEntry &other);
GDirEntry& operator=(const GDirEntry &other);
GooString *name; // dir/file name
GooString *fullPath;
GBool dir; // is it a directory?
};
class GDir {
public:
GDir(char *name, GBool doStatA = gTrue);
~GDir();
GDirEntry *getNextEntry();
void rewind();
private:
GDir(const GDir &other);
GDir& operator=(const GDir &other);
GooString *path; // directory path
GBool doStat; // call stat() for each entry?
#if defined(_WIN32)
WIN32_FIND_DATAA ffd;
HANDLE hnd;
#elif defined(ACORN)
#elif defined(MACOS)
#else
DIR *dir; // the DIR structure from opendir()
#ifdef VMS
GBool needParent; // need to return an entry for [-]
#endif
#endif
};
#endif #endif
...@@ -68,6 +68,7 @@ ...@@ -68,6 +68,7 @@
#include "goo/GooString.h" #include "goo/GooString.h"
#include "goo/GooList.h" #include "goo/GooList.h"
#include "goo/gfile.h" #include "goo/gfile.h"
#include "goo/gdir.h"
#include "Error.h" #include "Error.h"
#include "NameToCharCode.h" #include "NameToCharCode.h"
#include "CharCodeToUnicode.h" #include "CharCodeToUnicode.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment