1
0
Fork 0
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:
jules 2014-01-04 18:26:03 +00:00
parent ecaf9eb1ac
commit eee868ae02
41 changed files with 151 additions and 108 deletions

View file

@ -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;
}