You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: include/hgl/io/hypergraph_fio.hpp
+37-3Lines changed: 37 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,9 @@
2
2
// This file is part of the CPP-GL project (https://github.com/SpectraL519/cpp-gl).
3
3
// Licensed under the MIT License. See the LICENSE file in the project root for full license information.
4
4
5
+
/// @file hgl/io/hypergraph_fio.hpp
6
+
/// @brief File I/O utilities for safely saving and loading hypergraphs to and from files.
7
+
5
8
#pragma once
6
9
7
10
#include"gl/io/graph_fio.hpp"
@@ -15,8 +18,15 @@
15
18
16
19
namespacehgl::io {
17
20
18
-
using gl::io::append;
19
-
using gl::io::write;
21
+
/// @ingroup HGL-IO
22
+
/// @copybrief gl::io::append
23
+
/// @copydetails gl::io::append
24
+
using append = gl::io::append;
25
+
26
+
/// @ingroup HGL-IO
27
+
/// @copybrief gl::io::write
28
+
/// @copydetails gl::io::write
29
+
using write = gl::io::write;
20
30
21
31
namespacedetail {
22
32
@@ -25,6 +35,19 @@ using gl::io::detail::open_outfile;
25
35
26
36
} // namespace detail
27
37
38
+
/// @ingroup HGL-IO
39
+
/// @brief Serializes and saves a hypergraph to a file.
40
+
///
41
+
/// Writes the topology and optionally the properties of the hypergraph to the specified file using the Hypergraph Specification Format (HGSF). By default,
42
+
/// The function strictly respects the @ref hgl::io::write "write" and @ref hgl::io::append "append" safety guards.
43
+
///
44
+
/// @tparam HypergraphType The concrete type of the hypergraph being saved. Must satisfy [**c_hypergraph**](hgl_concepts.md#hgl-traits-c-hypergraph).
45
+
/// @tparam Mode The file access mode (e.g., @ref hgl::io::write "write" or @ref hgl::io::append "append").
46
+
/// @param hypergraph The hypergraph instance to serialize.
47
+
/// @param path The filesystem path where the hypergraph will be saved. Defaults to `"hypergraph.hgsf"`.
48
+
/// @param options An optional initializer list of stream manipulators to configure the output (e.g., `{hgl::io::with_properties}`).
49
+
/// @throws std::filesystem::filesystem_error If file safety checks fail (e.g., overwriting an existing file in `write` mode).
50
+
/// @throws std::ios_base::failure If the underlying file stream cannot be opened.
0 commit comments