mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Introjucer: projects now include a JUCE_APP_VERSION macro containing the version number.
This commit is contained in:
parent
ecaf9eb1ac
commit
eee868ae02
41 changed files with 151 additions and 108 deletions
|
|
@ -432,25 +432,25 @@ void Project::createPropertyEditors (PropertyListBuilder& props)
|
|||
}
|
||||
|
||||
//==============================================================================
|
||||
static StringArray getConfigs (const Project& p)
|
||||
static StringArray getVersionSegments (const Project& p)
|
||||
{
|
||||
StringArray configs;
|
||||
configs.addTokens (p.getVersionString(), ",.", String::empty);
|
||||
configs.trim();
|
||||
configs.removeEmptyStrings();
|
||||
return configs;
|
||||
StringArray segments;
|
||||
segments.addTokens (p.getVersionString(), ",.", "");
|
||||
segments.trim();
|
||||
segments.removeEmptyStrings();
|
||||
return segments;
|
||||
}
|
||||
|
||||
int Project::getVersionAsHexInteger() const
|
||||
{
|
||||
const StringArray configs (getConfigs (*this));
|
||||
const StringArray segments (getVersionSegments (*this));
|
||||
|
||||
int value = (configs[0].getIntValue() << 16)
|
||||
+ (configs[1].getIntValue() << 8)
|
||||
+ configs[2].getIntValue();
|
||||
int value = (segments[0].getIntValue() << 16)
|
||||
+ (segments[1].getIntValue() << 8)
|
||||
+ segments[2].getIntValue();
|
||||
|
||||
if (configs.size() >= 4)
|
||||
value = (value << 8) + configs[3].getIntValue();
|
||||
if (segments.size() >= 4)
|
||||
value = (value << 8) + segments[3].getIntValue();
|
||||
|
||||
return value;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue