CMakeLists.txt | 1 goo/gdir.h | 91 ++++++++++++++++++++++++++++++++++++++++++++++++ goo/gfile.cc | 1 goo/gfile.h | 49 ------------------------- poppler/GlobalParams.cc | 1 5 files changed, 94 insertions(+), 49 deletions(-)
New commits: commit 574840c5a61a9a20c930dd6fec63e6cf11bacfa5 Author: Christian Persch <[email protected]> Date: Wed Sep 5 21:19:04 2018 +0200 goo: Split GDir and GDirEntry out of gfile.h This allows including gfile.h together with glib.h which has a conflicting GDir type. https://gitlab.freedesktop.org/poppler/poppler/issues/370 diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a56cbb8..0e7d44a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -582,6 +582,7 @@ if(ENABLE_XPDF_HEADERS) goo/GooString.h goo/gtypes.h goo/gmem.h + goo/gdir.h goo/gfile.h goo/FixedPoint.h goo/ImgWriter.h diff --git a/goo/gdir.h b/goo/gdir.h new file mode 100644 index 00000000..1eb1dae5 --- /dev/null +++ b/goo/gdir.h @@ -0,0 +1,91 @@ +//======================================================================== +// +// 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 <[email protected]> +// Copyright (C) 2009, 2011, 2012, 2017, 2018 Albert Astals Cid <[email protected]> +// Copyright (C) 2009 Kovid Goyal <[email protected]> +// Copyright (C) 2013 Adam Reichold <[email protected]> +// Copyright (C) 2013, 2017 Adrian Johnson <[email protected]> +// Copyright (C) 2014 Bogdan Cristea <[email protected]> +// Copyright (C) 2014 Peter Breitenlohner <[email protected]> +// Copyright (C) 2017 Christoph Cullmann <[email protected]> +// Copyright (C) 2017 Thomas Freitag <[email protected]> +// Copyright (C) 2018 Mojca Miklavec <[email protected]> +// +// 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 diff --git a/goo/gfile.cc b/goo/gfile.cc index 381a0ce2..720f75aa 100644 --- a/goo/gfile.cc +++ b/goo/gfile.cc @@ -56,6 +56,7 @@ #include <limits> #include "GooString.h" #include "gfile.h" +#include "gdir.h" // Some systems don't define this, so just make it something reasonably // large. diff --git a/goo/gfile.h b/goo/gfile.h index 4ce805ee..395509a6 100644 --- a/goo/gfile.h +++ b/goo/gfile.h @@ -171,53 +171,4 @@ private: #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 diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc index 6d8941ea..c1131df3 100644 --- a/poppler/GlobalParams.cc +++ b/poppler/GlobalParams.cc @@ -68,6 +68,7 @@ #include "goo/GooString.h" #include "goo/GooList.h" #include "goo/gfile.h" +#include "goo/gdir.h" #include "Error.h" #include "NameToCharCode.h" #include "CharCodeToUnicode.h" _______________________________________________ poppler mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/poppler
