Vendetta/API/get whole ver

From Quasar-RCE
Revision as of 15:06, 3 March 2025 by Wikiadmin (talk | contribs) (created get_whole_ver)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Definition

lib.get_whole_ver (string version) :: table version_data, table metadata

Description

Break down a semantic version string or similar and return as itemized tables

Arguments

  1. string version: String to be broken apart

Returns

  1. table version_data: main version data, each individual number seperated into individual keys
  2. table metadata: extra suffix attached to some version strings

Other notes

  • Added in LME 3.4.x
  • While this function was designed with Semantic versioning in mind, it will support in theory any version string where numbers are seperated by non numbers. The only restricted character is the hyphen (-), which denotes the beginning of metadata.
  • Currently, all metadata is stored in the first key of the metadata table. While it might seem more intuitive to just return a string comprising of the metadata, in the future this function may be able to break metadata into individual components if neccesary, so for long-term compatibility it will return a table.

Examples of what to expect using this function:

  • Pure semantic style: "1.4.4 -beta"
    • {1, 4, 4}, {beta}
  • VO Update versioning: "1.8.640.1"
    • {1, 8, 640, 1}, {}
  • Incremental Version Numbering: "4"
    • {4},{}
  • Release/date/build number: "r16y23m3 -b104"
    • {16, 23, 3}, {b104}

As you can see, it allows Neoloader to be versatile in handling a wide range of modder preferences, as long as their own individual styles remain consistant.