Repository navigation
Releases: sanamhub/nepdate-cpp
Releases · sanamhub/nepdate-cpp
Release list
v0.1.0-beta.1
First public pre-release. The API may still change before 0.1.0.
Two packages from one tag: header-only nepdate and the compiled nepdate-patro. The public
surface is in docs/API.md.
Added
- BS and AD conversion.
dateis a 4-byte Bikram Sambat date;make_date,from_gregorian,
from_sys_daysand theto_*members convert both ways. Conversion isconstexprand
allocates nothing. All 109,212 days from BS 1901 to 2199 round-trip BS to AD to BS in the
tests, and the shared conversion vectors pass. - Arithmetic and fiscal year.
add_days,add_months,add_years,diff,date_rangeand
fiscal_year, with the shared clamp and spill rules. - Formatting and parsing.
to_chars_*write into the caller's buffer and allocate nothing;
parseandparse_lenientareconstexproverstd::string_viewand reject rather than
guess. - The patro.
nepdate::patroprovidesinfo,coverage,public_holidays,tithiandevent
for tithi, public holidays and events over BS 2077 to 2084. - vcpkg overlay ports and Conan recipes for both packages.
NEPDATE_VERSION_PRERELEASEin<nepdate/version.hpp>: the semver pre-release part (beta.1),
empty for a stable version.project()holds numbers only, soNEPDATE_VERSION_STRINGcarries
the full version.- C++20, built and tested on GCC 12, Clang 16 (with libstdc++ and with libc++), Apple Clang 16 and
MSVC 19.44, each also with exceptions and RTTI disabled.
Notes
- Benchmarks against C# NepDate are in
docs/benchmarks.md. BS to AD is 7.09 ns on MSVC and
5.58 ns on Clang against 13.29 ns for C# NepDate, with zero allocation. The patro month grid
(B8) misses its target and is reported there.
Install
With CMake FetchContent, from the archive attached here:
include(FetchContent)
FetchContent_Declare(nepdate
URL https://github.com/sanamhub/nepdate-cpp/releases/download/v0.1.0-beta.1/nepdate-cpp-0.1.0-beta.1.tar.gz
URL_HASH SHA256=72d50e97f6e4cc253fdd287dd33e9759cfe361c1c70ff1e910845d4fbbf099c7)
FetchContent_MakeAvailable(nepdate)
target_link_libraries(your_app PRIVATE nepdate::nepdate nepdate::patro)Or extract the archive, cmake --install it, and use find_package(nepdate) and
find_package(nepdate-patro). vcpkg and Conan Center listings follow upstream review.
Verification
gh release download v0.1.0-beta.1 --repo sanamhub/nepdate-cpp
sha256sum -c SHA256SUMS
gh attestation verify nepdate-cpp-0.1.0-beta.1.tar.gz --repo sanamhub/nepdate-cppAfter this release, verify-published downloaded these files, checked both, and built a
consumer from the archive on Linux, macOS and Windows.