本文整理汇总了C++中StringPairArray类的典型用法代码示例。如果您正苦于以下问题:C++ StringPairArray类的具体用法?C++ StringPairArray怎么用?C++ StringPairArray使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了StringPairArray类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: defs
StringPairArray ProjectExporter::getAllPreprocessorDefs() const
{
StringPairArray defs (mergePreprocessorDefs (project.getPreprocessorDefs(),
parsePreprocessorDefs (getExporterPreprocessorDefsString())));
defs.set (getExporterIdentifierMacro(), "1");
return defs;
}
示例2: mergePreprocessorDefs
StringPairArray mergePreprocessorDefs (StringPairArray inheritedDefs, const StringPairArray& overridingDefs)
{
for (int i = 0; i < overridingDefs.size(); ++i)
inheritedDefs.set (overridingDefs.getAllKeys()[i], overridingDefs.getAllValues()[i]);
return inheritedDefs;
}
示例3: login
void SmugMug::login(const String& username, const String& password)
{
sessionId = String::empty;
StringPairArray params;
params.set(("EmailAddress"), username);
params.set(("Password"), password);
XmlElement* n = smugMugRequest(("smugmug.login.withPassword"), params);
if (n)
{
XmlElement* l = n->getChildByName(("Login"));
if (l)
{
accountType = l->getStringAttribute(("AccountType"));
XmlElement* s = l->getChildByName(("Session"));
if (s)
{
sessionId = s->getStringAttribute(("id"));
addLogEntry(("Info: logged in session: ") + sessionId);
}
}
delete n;
}
}
示例4: addTargetSpecificPreprocessorDefs
void ProjectExporter::addTargetSpecificPreprocessorDefs (StringPairArray& defs, const ProjectType::Target::Type targetType) const
{
std::pair<String, ProjectType::Target::Type> targetFlags[] = {
{"JucePlugin_Build_VST", ProjectType::Target::VSTPlugIn},
{"JucePlugin_Build_VST3", ProjectType::Target::VST3PlugIn},
{"JucePlugin_Build_AU", ProjectType::Target::AudioUnitPlugIn},
{"JucePlugin_Build_AUv3", ProjectType::Target::AudioUnitv3PlugIn},
{"JucePlugin_Build_RTAS", ProjectType::Target::RTASPlugIn},
{"JucePlugin_Build_AAX", ProjectType::Target::AAXPlugIn},
{"JucePlugin_Build_Standalone", ProjectType::Target::StandalonePlugIn}
};
if (targetType == ProjectType::Target::SharedCodeTarget)
{
for (auto& flag : targetFlags)
defs.set (flag.first, (shouldBuildTargetType (flag.second) ? "1" : "0"));
defs.set ("JUCE_SHARED_CODE", "1");
}
else if (targetType != ProjectType::Target::unspecified)
{
for (auto& flag : targetFlags)
defs.set (flag.first, (targetType == flag.second ? "1" : "0"));
}
}
示例5: findTimeSigEvents
static void findTimeSigEvents (MidiFile& midiFile, StringPairArray& midiMetadata)
{
MidiMessageSequence timeSigEvents;
midiFile.findAllTimeSigEvents (timeSigEvents);
const int numTimeSigEvents = timeSigEvents.getNumEvents();
MemoryOutputStream timeSigSequence;
for (int i = 0; i < numTimeSigEvents; ++i)
{
int numerator, denominator;
timeSigEvents.getEventPointer(i)->message.getTimeSignatureInfo (numerator, denominator);
String timeSigString;
timeSigString << numerator << '/' << denominator;
if (i == 0)
midiMetadata.set (CoreAudioFormat::timeSig, timeSigString);
if (numTimeSigEvents > 1)
timeSigSequence << timeSigString << ',' << timeSigEvents.getEventTime (i) << ';';
}
if (timeSigSequence.getDataSize() > 0)
midiMetadata.set ("time signature sequence", timeSigSequence.toUTF8());
}
示例6: findTempoEvents
static void findTempoEvents (MidiFile& midiFile, StringPairArray& midiMetadata)
{
MidiMessageSequence tempoEvents;
midiFile.findAllTempoEvents (tempoEvents);
const int numTempoEvents = tempoEvents.getNumEvents();
MemoryOutputStream tempoSequence;
for (int i = 0; i < numTempoEvents; ++i)
{
const double tempo = getTempoFromTempoMetaEvent (tempoEvents.getEventPointer (i));
if (tempo > 0.0)
{
if (i == 0)
midiMetadata.set (CoreAudioFormat::tempo, String (tempo));
if (numTempoEvents > 1)
tempoSequence << String (tempo) << ',' << tempoEvents.getEventTime (i) << ';';
}
}
if (tempoSequence.getDataSize() > 0)
midiMetadata.set ("tempo sequence", tempoSequence.toUTF8());
}
示例7: getImageUrls
bool SmugMug::getImageUrls(SmugID id, ImageUrls& urls)
{
StringPairArray params;
params.set(("ImageID"), String(id.id));
params.set(("ImageKey"), id.key);
params.set(("Password"), "");
XmlElement* n = smugMugRequest(("smugmug.images.getURLs"), params);
if (n)
{
XmlElement* img = n->getChildByName(("Image"));
if (img)
{
urls.originalURL = img->getStringAttribute(("OriginalURL"));
urls.largeURL = img->getStringAttribute(("LargeURL"));
urls.mediumURL = img->getStringAttribute(("MediumURL"));
urls.smallURL = img->getStringAttribute(("SmallURL"));
urls.tinyURL = img->getStringAttribute(("TinyURL"));
urls.thumbURL = img->getStringAttribute(("ThumbURL"));
urls.albumURL = img->getStringAttribute(("AlbumURL"));
}
delete n;
return true;
}
return false;
}
示例8: findKeySigEvents
static void findKeySigEvents (MidiFile& midiFile, StringPairArray& midiMetadata)
{
MidiMessageSequence keySigEvents;
midiFile.findAllKeySigEvents (keySigEvents);
const int numKeySigEvents = keySigEvents.getNumEvents();
MemoryOutputStream keySigSequence;
for (int i = 0; i < numKeySigEvents; ++i)
{
const MidiMessage& message (keySigEvents.getEventPointer (i)->message);
const int key = jlimit (0, 14, message.getKeySignatureNumberOfSharpsOrFlats() + 7);
const bool isMajor = message.isKeySignatureMajorKey();
static const char* majorKeys[] = { "Cb", "Gb", "Db", "Ab", "Eb", "Bb", "F", "C", "G", "D", "A", "E", "B", "F#", "C#" };
static const char* minorKeys[] = { "Ab", "Eb", "Bb", "F", "C", "G", "D", "A", "E", "B", "F#", "C#", "G#", "D#", "A#" };
String keySigString (isMajor ? majorKeys[key]
: minorKeys[key]);
if (! isMajor)
keySigString << 'm';
if (i == 0)
midiMetadata.set (CoreAudioFormat::keySig, keySigString);
if (numKeySigEvents > 1)
keySigSequence << keySigString << ',' << keySigEvents.getEventTime (i) << ';';
}
if (keySigSequence.getDataSize() > 0)
midiMetadata.set ("key signature sequence", keySigSequence.toUTF8());
}
示例9: create
static void create (MemoryBlock& block, const StringPairArray& values)
{
auto numNotes = values.getValue ("NumCueNotes", "0").getIntValue();
if (numNotes > 0)
{
MemoryOutputStream out (block, false);
out.writeShortBigEndian ((short) numNotes);
for (int i = 0; i < numNotes; ++i)
{
auto prefix = "CueNote" + String (i);
out.writeIntBigEndian (values.getValue (prefix + "TimeStamp", "0").getIntValue());
out.writeShortBigEndian ((short) values.getValue (prefix + "Identifier", "0").getIntValue());
auto comment = values.getValue (prefix + "Text", String());
auto commentLength = jmin (comment.getNumBytesAsUTF8(), (size_t) 65534);
out.writeShortBigEndian ((short) commentLength + 1);
out.write (comment.toUTF8(), commentLength);
out.writeByte (0);
if ((out.getDataSize() & 1) != 0)
out.writeByte (0);
}
}
}
示例10: sendProjectButtonAnalyticsEvent
//======================================================================
static void sendProjectButtonAnalyticsEvent (StringRef label)
{
StringPairArray data;
data.set ("label", label);
Analytics::getInstance()->logEvent ("Project Button", data, ProjucerAnalyticsEvent::projectEvent);
}
示例11: create
void create (MemoryBlock& block, const StringPairArray& values)
{
const int numNotes = values.getValue ("NumCueNotes", "0").getIntValue();
if (numNotes > 0)
{
MemoryOutputStream out (block, false);
out.writeShortBigEndian ((short) numNotes);
for (int i = 0; i < numNotes; ++i)
{
const String prefix ("CueNote" + String (i));
out.writeIntBigEndian (values.getValue (prefix + "TimeStamp", "0").getIntValue());
out.writeShortBigEndian ((short) values.getValue (prefix + "Identifier", "0").getIntValue());
const String comment (values.getValue (prefix + "Text", String::empty));
out.write (comment.toUTF8(), jmin (comment.getNumBytesAsUTF8(), 65534));
out.writeByte (0);
if ((out.getDataSize() & 1) != 0)
out.writeByte (0);
}
}
}
示例12: metaDataContainsZeroIdentifiers
bool metaDataContainsZeroIdentifiers (const StringPairArray& values)
{
// (zero cue identifiers are valid for WAV but not for AIFF)
const String cueString ("Cue");
const String noteString ("CueNote");
const String identifierString ("Identifier");
const StringArray& keys = values.getAllKeys();
for (int i = 0; i < keys.size(); ++i)
{
const String key (keys[i]);
if (key.startsWith (noteString))
continue; // zero identifier IS valid in a COMT chunk
if (key.startsWith (cueString) && key.contains (identifierString))
{
const int value = values.getValue (key, "-1").getIntValue();
if (value == 0)
return true;
}
}
return false;
}
示例13: setData
//==============================================================================
static void setData (const AnalyticsDestination::AnalyticsEvent& event, StringPairArray& data)
{
data.set ("ea", event.name);
if (event.parameters.getAllKeys().contains ("label"))
data.set ("el", event.parameters.getValue ("label", {}));
data.addArray (event.userProperties);
}
示例14: parseInformationChunk
//==============================================================================
static StringPairArray parseInformationChunk (InputStream& input)
{
StringPairArray infoStrings;
const uint32 numEntries = (uint32) input.readIntBigEndian();
for (uint32 i = 0; i < numEntries; ++i)
infoStrings.set (input.readString(), input.readString());
return infoStrings;
}
示例15: getImages
bool SmugMug::getImages(OwnedArray<ImageItem>& images, SmugID albumId)
{
StringPairArray params;
params.set(("AlbumID"), String(albumId.id));
params.set(("AlbumKey"), albumId.key);
params.set(("Heavy"), ("1"));
XmlElement* n = smugMugRequest(("smugmug.images.get"), params);
if (n)
{
XmlElement* a = n->getChildByName(("Album"));
if (a)
{
XmlElement* i = a->getChildByName(("Images"));
if (i)
{
XmlElement* img = i->getChildByName(("Image"));
while (img)
{
ImageItem* itm = new ImageItem();
itm->id.id = img->getIntAttribute(("id"));
itm->id.key = img->getStringAttribute(("Key"));
itm->filename = img->getStringAttribute(("FileName"));
itm->caption = img->getStringAttribute((""));
itm->keywords = img->getStringAttribute((""));
itm->position = img->getIntAttribute(("Position"));
itm->date = img->getStringAttribute(("Date"));
itm->format = img->getStringAttribute(("Format"));
itm->serial = img->getIntAttribute(("Serial"));
itm->watermark = img->getBoolAttribute(("Watermark"));
itm->size = img->getIntAttribute(("Size"));
itm->width = img->getIntAttribute(("Width"));
itm->height = img->getIntAttribute(("Height"));
itm->md5sum = img->getStringAttribute(("MD5Sum"));
itm->lastUpdated = img->getStringAttribute(("LastUpdated"));
itm->originalURL = img->getStringAttribute(("OriginalURL"));
itm->largeURL = img->getStringAttribute(("LargeURL"));
itm->mediumURL = img->getStringAttribute(("MediumURL"));
itm->smallURL = img->getStringAttribute(("SmallURL"));
itm->tinyURL = img->getStringAttribute(("TinyURL"));
itm->thumbURL = img->getStringAttribute(("ThumbURL"));
itm->albumURL = img->getStringAttribute(("AlbumURL"));
images.add(itm);
img = img->getNextElementWithTagName(("Image"));
}
}
}
delete n;
return images.size() > 0;
}
return false;
}