Skip to content

Commit 607c74d

Browse files
authored
Merge pull request #11 from arbCoding/devel
Custom exceptions and greater type safety.
2 parents 1b74ff5 + 322b6fb commit 607c74d

7 files changed

Lines changed: 837 additions & 626 deletions

File tree

docs/index.html

Lines changed: 59 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/sac-format_manual.pdf

1.08 KB
Binary file not shown.

src/docs/index.org

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ with binary [[https://ds.iris.edu/files/sac-manual/manual/file_format.html][SAC]
4343
and easy to read programming-style while providing the high performance brought
4444
by C++.
4545

46-
sac-format's actively developed on [[https://github.com/arbCoding/sac-format][GitHub]]!
46+
sac-format's developed on [[https://github.com/arbCoding/sac-format][GitHub]]!
4747

4848
[[https://arbcoding.github.io/sac-format/sac-format_manual.pdf][Download]] an offline version of the documentation (PDF).
4949

@@ -56,17 +56,22 @@ working on Windows, macOS, and Linux systems.
5656

5757
*** Safe
5858

59-
sac-format is *safe*---testing is an important part of software development. The
60-
sac-format library is extensively tested using the [[https://github.com/catchorg/Catch2][Catch2]] testing framework.
61-
Everything from low-level binary conversions to high-level =Trace= reading/writing
62-
are tested and confirmed working. Check and run the tests yourself. See the
63-
[[Testing][Testing]] section for more information.
59+
sac-format is *safe*---it conforms to a strict set of C++ programming guidelines,
60+
chosen to ensure safe code-execution. The guideline conformance list is in
61+
[[https://github.com/arbCoding/sac-format/blob/main/.github/workflows/cpp-linter.yml][=cpp-linter.yml=]] and can be cross-referenced against this [[https://clang.llvm.org/extra/clang-tidy/checks/list.html][master list]]. Results
62+
of conformance checking is [[https://github.com/arbCoding/sac-format/actions/workflows/cpp-linter.yml][here]].
63+
64+
Testing is an important part of software development; the sac-format library is
65+
extensively tested using the [[https://github.com/catchorg/Catch2][Catch2]] testing framework. Everything from low-level
66+
binary conversions to high-level =Trace= reading/writing are tested and confirmed
67+
working. Check and run the tests yourself. See the [[Testing][Testing]] section for more
68+
information.
6469

6570
*** Fast
6671

67-
sac-format is *fast*---it's written in C++ and extensively benchmarked. You can
68-
run the benchmarks yourself to find out how sac-format performs on your system.
69-
See the [[Benchmarking][Benchmarking]] section for more information.
72+
sac-format is *fast*---it's written in C++, carefully optimized, and extensively
73+
benchmarked. You can run the benchmarks yourself to find out how sac-format
74+
performs on your system. See the [[Benchmarking][Benchmarking]] section for more information.
7075

7176
*** Easy
7277

@@ -78,7 +83,7 @@ running.
7883
*** Small
7984

8085
sac-format is *small*---in total (header + implementation--excluding comments)
81-
it's fewer than 2000 lines of code. Small size opens the door to using on any
86+
it's fewer than 2500 lines of code. Small size opens the door to using on any
8287
sort of hardware (old or new) and makes it easy to expand upon.
8388

8489
*** Documented
@@ -118,7 +123,7 @@ build tool, and then building.
118123

119124
**** GCC
120125

121-
#+attr_latex: :options frame=lines, framesep=2mm, baselinestretch=1.2, fontsize=\footnotesize
126+
#+attr_latex: :options frame=lines, framesep=2mm, baselinestretch=1.2, fontsize=\footnotesize, bgcolor=LightGray
122127
#+begin_src bash :returns code :eval no
123128
git clone https://github.com/arbCoding/sac-format.git
124129
cmake --preset gcc-release
@@ -127,7 +132,7 @@ cmake --build ./build/release/gcc
127132

128133
**** Clang
129134

130-
#+attr_latex: :options frame=lines, framesep=2mm, baselinestretch=1.2, fontsize=\footnotesize
135+
#+attr_latex: :options frame=lines, framesep=2mm, baselinestretch=1.2, fontsize=\footnotesize, bgcolor=LightGray
131136
#+begin_src bash :returns code :eval no
132137
git clone https://github.com/arbCoding/sac-format.git
133138
cmake --preset clang-release
@@ -152,7 +157,7 @@ well as the true size of the [[=data1=][=data1=]] and [[=data2=][=data2=]] vecto
152157
To integrate sac-format into your CMake project, add it to your =CMakeLists.txt=.
153158

154159
#+latex: \begin{center}\begin{minipage}[t]{0.75\textwidth}
155-
#+attr_latex: :options frame=lines, framesep=2mm, baselinestretch=1.2, fontsize=\footnotesize, linenos
160+
#+attr_latex: :options frame=lines, framesep=2mm, baselinestretch=1.2, fontsize=\footnotesize, linenos, bgcolor=LightGray
156161
#+begin_src cmake :eval no
157162
include(FetchContent)
158163
set(FETCHCONTENT_UPDATES_DISCONNECTED TRUE)
@@ -180,7 +185,7 @@ target_link_libraries_library(your_executable
180185

181186
#+latex: \begin{center}\begin{minipage}[t]{0.75\textwidth}
182187
#+name: empty_trace_example
183-
#+attr_latex: :options frame=lines, framesep=2mm, baselinestretch=1.2, fontsize=\footnotesize, linenos
188+
#+attr_latex: :options frame=lines, framesep=2mm, baselinestretch=1.2, fontsize=\footnotesize, linenos, bgcolor=LightGray
184189
#+begin_src cpp :cache yes :returns code :results verbatim :flags -std=c++20 -L../../bin/libsac-format.a -I../ :eval no
185190
#include <filesystem>
186191
#include <iostream>
@@ -215,11 +220,13 @@ The =Trace= class provides easy access to SAC-files in C++. Each SAC-file is a
215220

216221
*** Reading SAC
217222

218-
SAC-files can be read in by using the parameterized constructor with a [[https://en.cppreference.com/w/cpp/filesystem/path][=std::filesystem::path=]] ([[https://en.cppreference.com/w/cpp/header/filesystem][=<filesystem>=]]) or a [[https://en.cppreference.com/w/cpp/string/basic_string][=std::string=]] ([[https://en.cppreference.com/w/cpp/header/string][=<string>=]]) variable that corresponds to the location of the SAC-file.
223+
SAC-files can be read in by using the parameterized constructor with a
224+
[[https://en.cppreference.com/w/cpp/filesystem/path][=std::filesystem::path=]] ([[https://en.cppreference.com/w/cpp/header/filesystem][=<filesystem>=]]) or a [[https://en.cppreference.com/w/cpp/string/basic_string][=std::string=]] ([[https://en.cppreference.com/w/cpp/header/string][=<string>=]])
225+
variable that corresponds to the location of the SAC-file.
219226

220227
For example:
221228
#+latex: \begin{center}\begin{minipage}[t]{0.75\textwidth}
222-
#+attr_latex: :options frame=lines, framesep=2mm, baselinestretch=1.2, fontsize=\footnotesize, linenos
229+
#+attr_latex: :options frame=lines, framesep=2mm, baselinestretch=1.2, fontsize=\footnotesize, linenos, bgcolor=LightGray
223230
#+begin_src C++ :eval no
224231
#include <filesystem>
225232
#include <sac_foramt.hpp>
@@ -287,8 +294,8 @@ a [[Lookup Table][lookup table]]. The internal components are below:
287294

288295
*** Exceptions
289296

290-
sac-format throws exceptions of type =std::domain_exception= in the event of a
291-
failure to read/write a SAC-file.
297+
sac-format throws exceptions of type =sacfmt::io_error= in the event of a failure
298+
to read/write a SAC-file.
292299

293300
** Low-Level I/O
294301

@@ -363,7 +370,7 @@ length.
363370
***** =equal_within_tolerance=
364371

365372
Floating-point/double-precision equality within a provided tolerance (default is
366-
=f_eps=, defined in [[=sac_format.hpp=]]).
373+
=f_eps=, defined in =sac_format.hpp=).
367374

368375
** Testing
369376

@@ -417,7 +424,7 @@ Implementation---function details.
417424

418425
**** =util.hpp=
419426

420-
Utility functions and constants exclusive to testing and benchmarking. Is not
427+
Utility functions and constants exclusive to testing and benchmarking. Not
421428
split into interface/implementation.
422429

423430
**** =utests.cpp=

src/docs/misc/settings.org

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#+latex_header: \usepackage{minted}
1717
#+latex_header: \setminted{breaklines}
1818
#+latex_header: \usepackage{xcolor}
19+
#+latex_header: \definecolor{LightGray}{gray}{0.975}
1920
#+latex_header: \usemintedstyle{emacs}
2021
#+latex_header: \usepackage{mathtools}
2122
#+latex_header: \usepackage[twoside, letterpaper, lmargin=1.0in, rmargin=0.75in, bmargin=0.75in, tmargin=1.0in]{geometry}

0 commit comments

Comments
 (0)