Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unixstl::readdir_sequence now supports sockets #67

Merged
merged 5 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
STLSoft - Changes

; Created: 29th March 2002
; Updated: 31st January 2025
; Updated: 21st February 2025

============================================================================

Expand All @@ -19,17 +19,21 @@ STLSoft - Changes



Changes for 1.11.1-beta2 (31st January 2025)
Changes for 1.11.1-beta2 (21st February 2025)

General:
========

* `unixstl::readdir_sequence` now can search for sockets, in addition to files and directories;
* GCC (11) compatibility around use of `__builtin_is_constant_evaluated` (when not C++20);
* T.B.C.

Changes:
========

`unixstl::readdir_sequence` now can search for sockets, in addition to files and directories:
* T.B.C.

GCC (11) compatibility around use of `__builtin_is_constant_evaluated` (when not C++20):
* **stlsoft/stlsoft.h** : ~ `__builtin_is_constant_evaluated` must be called as if a function;

Expand Down
3 changes: 2 additions & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
----


31st January 2025 - 1.11.1-beta2 released
21st February 2025 - 1.11.1-beta2 released
-----------------------------------------

* `unixstl::readdir_sequence` now can search for sockets, in addition to files and directories;
* GCC (11) compatibility around use of `__builtin_is_constant_evaluated` (when not C++20);


Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

| Date | News Item |
| --------------------- | --------------------------------------------------------- |
| 31st January 2025 | Release of STLSoft 1.11.1-beta2 |
| 21st February 2025 | Release of STLSoft 1.11.1-beta2 |
| 31st December 2024 | Release of STLSoft 1.11.1-beta1 |
| 28th December 2024 | Release of STLSoft 1.11.1-alpha28 |
| 19th December 2024 | Release of STLSoft 1.11.1-alpha27 |
Expand Down
8 changes: 4 additions & 4 deletions include/stlsoft/stlsoft.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* and platform discriminations, and definitions of types.
*
* Created: 15th January 2002
* Updated: 30th January 2025
* Updated: 21dst February 2025
*
* Home: http://stlsoft.org/
*
Expand Down Expand Up @@ -55,8 +55,8 @@
#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
# define STLSOFT_VER_STLSOFT_H_STLSOFT_MAJOR 3
# define STLSOFT_VER_STLSOFT_H_STLSOFT_MINOR 57
# define STLSOFT_VER_STLSOFT_H_STLSOFT_REVISION 5
# define STLSOFT_VER_STLSOFT_H_STLSOFT_EDIT 585
# define STLSOFT_VER_STLSOFT_H_STLSOFT_REVISION 6
# define STLSOFT_VER_STLSOFT_H_STLSOFT_EDIT 586
#else /* ? STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* # include "./internal/doxygen_defs.h" */
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
Expand Down Expand Up @@ -377,7 +377,7 @@
# define _STLSOFT_VER_1_11_1_A27 0x010b015b /*!< Version 1.11.1 alpha 27 (19th December 2024) */
# define _STLSOFT_VER_1_11_1_A28 0x010b015c /*!< Version 1.11.1 alpha 28 (28th December 2024) */
# define _STLSOFT_VER_1_11_1_B1 0x010b0181 /*!< Version 1.11.1 beta 1 (31st December 2024) */
# define _STLSOFT_VER_1_11_1_B2 0x010b0182 /*!< Version 1.11.1 beta 2 (31st January 2024) */
# define _STLSOFT_VER_1_11_1_B2 0x010b0182 /*!< Version 1.11.1 beta 2 (21st February 2024) */
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */

#define _STLSOFT_VER_MAJOR 1
Expand Down
34 changes: 17 additions & 17 deletions include/unixstl/filesystem/readdir_sequence.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* Purpose: readdir_sequence class.
*
* Created: 15th January 2002
* Updated: 28th December 2024
* Updated: 20th February 2025
*
* Home: http://stlsoft.org/
*
* Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems
* Copyright (c) 2019-2025, Matthew Wilson and Synesis Information Systems
* Copyright (c) 2002-2019, Matthew Wilson and Synesis Software
* All rights reserved.
*
Expand Down Expand Up @@ -52,9 +52,9 @@

#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
# define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_READDIR_SEQUENCE_MAJOR 5
# define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_READDIR_SEQUENCE_MINOR 2
# define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_READDIR_SEQUENCE_REVISION 6
# define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_READDIR_SEQUENCE_EDIT 165
# define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_READDIR_SEQUENCE_MINOR 3
# define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_READDIR_SEQUENCE_REVISION 1
# define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_READDIR_SEQUENCE_EDIT 167
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */


Expand Down Expand Up @@ -242,12 +242,10 @@ class readdir_sequence
public:
enum
{
includeDots = 0x0008 /*!< Requests that dots directories be included in the returned sequence */
, directories = 0x0010 /*!< Causes the search to include directories */
, files = 0x0020 /*!< Causes the search to include files */
#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
, sockets = 0x0000 /*!< CURRENTLY UNSUPPORTED : DO NOT USE! This exists for forward compatibility with STLSoft 1.10 test programs, and is subject to change in the future. A future version will support sockets, but it may not use this enumerator name. */
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
includeDots = 0x0008 /*!< Requests that dots directories be included in the returned sequence. */
, directories = 0x0010 /*!< Causes the search to include directories. */
, files = 0x0020 /*!< Causes the search to include files. */
, sockets = 0x0040 /*!< Causes the search to include sockets. */
, typeMask = 0x0070
, fullPath = 0x0100 /*!< Each file entry is presented as a full path relative to the search directory. */
, absolutePath = 0x0200 /*!< The search directory is converted to an absolute path. */
Expand Down Expand Up @@ -547,6 +545,7 @@ readdir_sequence::validate_flags_(
| 0
| directories
| files
| sockets
| 0
| fullPath
| absolutePath
Expand All @@ -555,7 +554,7 @@ readdir_sequence::validate_flags_(
UNIXSTL_MESSAGE_ASSERT("Specification of unrecognised/unsupported flags", flags == (flags & validFlags));
STLSOFT_SUPPRESS_UNUSED(validFlags);

if (0 == (flags & (directories | files)))
if (0 == (flags & (directories | files | sockets)))
{
flags |= (directories | files);
}
Expand Down Expand Up @@ -886,14 +885,15 @@ readdir_sequence::const_iterator::operator ++()
else
{
#ifndef _WIN32
// Test for sockets : this version does not support sockets,
// but does elide them from the search results.
if (traits_type::is_socket(&st))
if (m_flags & sockets) // want sockets
{
continue;
if (traits_type::is_socket(&st))
{
// It is a socket, so accept it
break;
}
}
#endif /* !_WIN32 */

if (m_flags & directories) // Want directories
{
if (traits_type::is_directory(&st))
Expand Down
11 changes: 6 additions & 5 deletions include/unixstl/unixstl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
* platform discriminations, and definitions of types.
*
* Created: 15th January 2002
* Updated: 13th October 2024
* Updated: 21st February 2025
*
* Home: http://stlsoft.org/
*
* Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems
* Copyright (c) 2019-2025, Matthew Wilson and Synesis Information Systems
* Copyright (c) 2002-2019, Matthew Wilson and Synesis Software
* All rights reserved.
*
Expand Down Expand Up @@ -50,8 +50,8 @@
#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
# define UNIXSTL_VER_UNIXSTL_H_UNIXSTL_MAJOR 3
# define UNIXSTL_VER_UNIXSTL_H_UNIXSTL_MINOR 10
# define UNIXSTL_VER_UNIXSTL_H_UNIXSTL_REVISION 9
# define UNIXSTL_VER_UNIXSTL_H_UNIXSTL_EDIT 120
# define UNIXSTL_VER_UNIXSTL_H_UNIXSTL_REVISION 10
# define UNIXSTL_VER_UNIXSTL_H_UNIXSTL_EDIT 121
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */

/** \file unixstl/unixstl.h
Expand Down Expand Up @@ -147,12 +147,13 @@
# define _UNIXSTL_VER_1_8_4 0x010804ff /*!< Version 1.8.4 (with STLSoft 1.11.1 alpha 8) */
# define _UNIXSTL_VER_1_8_5 0x010805ff /*!< Version 1.8.5 (with STLSoft 1.11.1 alpha 12) */
# define _UNIXSTL_VER_1_8_6_A01 0x01080641 /*!< Version 1.8.8 alpha 1 (with STLSoft 1.11.1 alpha 17) */
# define _UNIXSTL_VER_1_8_6_B01 0x01080681 /*!< Version 1.8.8 beta 1 (with STLSoft 1.11.1 beta 2) */
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */

#define _UNIXSTL_VER_MAJOR 1
#define _UNIXSTL_VER_MINOR 8
#define _UNIXSTL_VER_REVISION 6
#define _UNIXSTL_VER _UNIXSTL_VER_1_8_6_A01
#define _UNIXSTL_VER _UNIXSTL_VER_1_8_6_B01


/* /////////////////////////////////////////////////////////////////////////
Expand Down
17 changes: 10 additions & 7 deletions include/winstl/filesystem/readdir_sequence.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* Purpose: Platform header for the readdir_sequence components.
*
* Created: 29th April 2006
* Updated: 19th December 2024
* Updated: 20th February 2025
*
* Home: http://stlsoft.org/
*
* Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems
* Copyright (c) 2019-2025, Matthew Wilson and Synesis Information Systems
* Copyright (c) 2006-2019, Matthew Wilson and Synesis Software
* All rights reserved.
*
Expand Down Expand Up @@ -55,8 +55,8 @@
#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
# define WINSTL_VER_WINSTL_FILESYSTEM_HPP_READDIR_SEQUENCE_MAJOR 3
# define WINSTL_VER_WINSTL_FILESYSTEM_HPP_READDIR_SEQUENCE_MINOR 0
# define WINSTL_VER_WINSTL_FILESYSTEM_HPP_READDIR_SEQUENCE_REVISION 1
# define WINSTL_VER_WINSTL_FILESYSTEM_HPP_READDIR_SEQUENCE_EDIT 38
# define WINSTL_VER_WINSTL_FILESYSTEM_HPP_READDIR_SEQUENCE_REVISION 2
# define WINSTL_VER_WINSTL_FILESYSTEM_HPP_READDIR_SEQUENCE_EDIT 40
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */


Expand Down Expand Up @@ -135,9 +135,12 @@ class readdir_sequence
public:
enum search_flags
{
includeDots = 0x0008 /*!< Requests that dots directories be included in the returned sequence */
, directories = 0x0010 /*!< Causes the search to include directories */
, files = 0x0020 /*!< Causes the search to include files */
includeDots = 0x0008 /*!< Requests that dots directories be included in the returned sequence. */
, directories = 0x0010 /*!< Causes the search to include directories. */
, files = 0x0020 /*!< Causes the search to include files. */
#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
, sockets = 0x0000 /*!< This has no effect on Windows, but is here for structural conformance compatibility with unixstl::readdir_sequence. */
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
, fullPath = 0x0100 /*!< Each file entry is presented as a full path relative to the search directory. */
, absolutePath = 0x0200 /*!< The search directory is converted to an absolute path. */
};
Expand Down
Loading