OpenXLSX 1.9.1
Loading...
Searching...
No Matches
XLDocument_Properties.cpp File Reference
#include <charconv>
#include <fmt/format.h>
#include <string>
#include <string_view>
#include "XLDocument.hpp"
#include "XLException.hpp"

Functions

bool getAppVersion (std::string_view versionString, int &majorVersion, int &minorVersion)
 extract an integer major version v1 and minor version v2 from a string
 

Function Documentation

◆ getAppVersion()

bool getAppVersion ( std::string_view  versionString,
int &  majorVersion,
int &  minorVersion 
)

extract an integer major version v1 and minor version v2 from a string

Extracts integer major and minor versions from a string, ensuring the formatting strictly complies with the OOXML AppVersion schema requirements. [0-9]{1,2}.[0-9]{1,4} (Example: 14.123)

Parameters
versionStringthe string to process
majorVersionby reference: store the major version here
minorVersionby reference: store the minor version here
Returns
true if string adheres to format & version numbers could be extracted
false in case of failure