本文整理汇总了C++中StringPairArray::set方法的典型用法代码示例。如果您正苦于以下问题:C++ StringPairArray::set方法的具体用法?C++ StringPairArray::set怎么用?C++ StringPairArray::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringPairArray
的用法示例。
在下文中一共展示了StringPairArray::set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: 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;
}
}
示例3: 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());
}
示例4: 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());
}
示例5: 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"));
}
}
示例6: 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());
}
示例7: 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);
}
示例8: 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;
}
示例9: testBackend
void testBackend (String type, int64 const seedValue, int numObjectsToTest = 2000)
{
DummyScheduler scheduler;
beginTestCase (String ("Backend type=") + type);
StringPairArray params;
File const path (File::createTempFile ("node_db"));
params.set ("type", type);
params.set ("path", path.getFullPathName ());
// Create a batch
Batch batch;
createPredictableBatch (batch, 0, numObjectsToTest, seedValue);
{
// Open the backend
ScopedPointer <Backend> backend (DatabaseImp::createBackend (params, scheduler));
// Write the batch
storeBatch (*backend, batch);
{
// Read it back in
Batch copy;
fetchCopyOfBatch (*backend, ©, batch);
expect (areBatchesEqual (batch, copy), "Should be equal");
}
{
// Reorder and read the copy again
Batch copy;
UnitTestUtilities::repeatableShuffle (batch.size (), batch, seedValue);
fetchCopyOfBatch (*backend, ©, batch);
expect (areBatchesEqual (batch, copy), "Should be equal");
}
}
{
// Re-open the backend
ScopedPointer <Backend> backend (DatabaseImp::createBackend (params, scheduler));
// Read it back in
Batch copy;
fetchCopyOfBatch (*backend, ©, batch);
// Canonicalize the source and destination batches
std::sort (batch.begin (), batch.end (), NodeObject::LessThan ());
std::sort (copy.begin (), copy.end (), NodeObject::LessThan ());
expect (areBatchesEqual (batch, copy), "Should be equal");
}
}
示例10: testImport
void testImport (String destBackendType, String srcBackendType, int64 seedValue)
{
DummyScheduler scheduler;
File const node_db (File::createTempFile ("node_db"));
StringPairArray srcParams;
srcParams.set ("type", srcBackendType);
srcParams.set ("path", node_db.getFullPathName ());
// Create a batch
Batch batch;
createPredictableBatch (batch, 0, numObjectsToTest, seedValue);
// Write to source db
{
ScopedPointer <Database> src (Database::New ("test", scheduler, srcParams));
storeBatch (*src, batch);
}
Batch copy;
{
// Re-open the db
ScopedPointer <Database> src (Database::New ("test", scheduler, srcParams));
// Set up the destination database
File const dest_db (File::createTempFile ("dest_db"));
StringPairArray destParams;
destParams.set ("type", destBackendType);
destParams.set ("path", dest_db.getFullPathName ());
ScopedPointer <Database> dest (Database::New ("test", scheduler, destParams));
beginTestCase (String ("import into '") + destBackendType + "' from '" + srcBackendType + "'");
// Do the import
dest->import (*src);
// Get the results of the import
fetchCopyOfBatch (*dest, ©, batch);
}
// Canonicalize the source and destination batches
std::sort (batch.begin (), batch.end (), NodeObject::LessThan ());
std::sort (copy.begin (), copy.end (), NodeObject::LessThan ());
expect (areBatchesEqual (batch, copy), "Should be equal");
}
示例11: getAllPreprocessorDefs
StringPairArray ProjectExporter::getAllPreprocessorDefs (const ProjectExporter::BuildConfiguration& config) const
{
StringPairArray defs (mergePreprocessorDefs (config.getAllPreprocessorDefs(),
parsePreprocessorDefs (getExporterPreprocessorDefsString())));
defs.set (getExporterIdentifierMacro(), "1");
return defs;
}
示例12: 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;
}
示例13: sendProjectButtonAnalyticsEvent
//======================================================================
static void sendProjectButtonAnalyticsEvent (StringRef label)
{
StringPairArray data;
data.set ("label", label);
Analytics::getInstance()->logEvent ("Project Button", data, ProjucerAnalyticsEvent::projectEvent);
}
示例14: createSubCategory
int SmugMug::createSubCategory(const int categoryId, const String& title)
{
int subCatId = -1;
StringPairArray params;
params.set(("CategoryID"), String(categoryId));
params.set(("Name"), title);
XmlElement* n = smugMugRequest(("smugmug.subcategories.create"), params);
if (n)
{
XmlElement* a = n->getChildByName(("SubCategory"));
if (a)
subCatId = a->getIntAttribute(("id"), -1);
delete n;
}
return subCatId;
}
示例15: 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;
}