MantisBase v0.4.9
Loading...
Searching...
No Matches
int_precision.h File Reference

Signed/unsigned integer width tokens for entity int fields (i8..u64). More...

#include <cstdint>
#include <optional>
#include <string>
#include <utility>
#include "nlohmann/json.hpp"
#include "soci/soci-backend.h"
#include "soci/values.h"
#include "../types.h"
Include dependency graph for int_precision.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  mb

Enumerations

enum class  mb::MbIntPrecision {
  mb::I8 , mb::I16 , mb::I32 , mb::I64 ,
  mb::U8 , mb::U16 , mb::U32 , mb::U64
}

Functions

MANTISBASE_API MbIntPrecision mb::defaultIntPrecision ()
MANTISBASE_API bool mb::isUnsignedIntPrecision (MbIntPrecision precision)
MANTISBASE_API std::string mb::intPrecisionToString (MbIntPrecision precision)
MANTISBASE_API MbIntPrecision mb::intPrecisionFromString (const std::string &token)
MANTISBASE_API MbIntPrecision mb::intPrecisionFromField (const nlohmann::json &field)
MANTISBASE_API soci::db_type mb::intPrecisionToSociType (MbIntPrecision precision)
MANTISBASE_API std::pair< int64_t, int64_t > mb::intPrecisionSignedRange (MbIntPrecision precision)
MANTISBASE_API std::pair< uint64_t, uint64_t > mb::intPrecisionUnsignedRange (MbIntPrecision precision)
MANTISBASE_API std::optional< std::string > mb::validateIntPrecisionToken (const std::string &token)
MANTISBASE_API std::optional< std::string > mb::validateIntFieldValue (const nlohmann::json &value, MbIntPrecision precision)
MANTISBASE_API std::optional< std::string > mb::validateIntConstraintBounds (const nlohmann::json &field)
MANTISBASE_API void mb::bindIntFieldValue (soci::values &vals, const std::string &field_name, const nlohmann::json &value, MbIntPrecision precision)
MANTISBASE_API nlohmann::json mb::readIntFieldValue (const soci::row &row, size_t index, MbIntPrecision precision)

Detailed Description

Signed/unsigned integer width tokens for entity int fields (i8..u64).

MbEntity int fields store a precision token (i32, u64, …) that controls SOCI binding, SQL column type, and validation range checks.