+#include <msp/core/algorithm.h>
#include <msp/fs/utils.h>
#include <msp/strings/format.h>
#include "androidapplicationcomponent.h"
void AndroidApplicationComponent::Loader::permission(const string &perm)
{
- obj.permissions.insert(perm);
+ if(!any_equals(obj.permissions, perm))
+ obj.permissions.push_back(perm);
}
#ifndef ANDROIDAPPLICATIONCOMPONENT_H_
#define ANDROIDAPPLICATIONCOMPONENT_H_
-#include <set>
#include "component.h"
class AndroidApplicationComponent: public Component
private:
std::string orientation;
- std::set<std::string> permissions;
+ std::vector<std::string> permissions;
public:
AndroidApplicationComponent(SourcePackage &, const std::string &);
+#include <msp/core/algorithm.h>
#include <msp/fs/utils.h>
#include "androidassetpackagingtool.h"
#include "androidmanifestfile.h"
else if(real->get_package()==res.get_package())
{
const FS::Path &path = file->get_path();
- resource_dirs.push_back(path.subpath(0, path.size()-2));
+ FS::Path res_dir = path.subpath(0, path.size()-2);
+ if(!any_equals(resource_dirs, res_dir))
+ resource_dirs.push_back(res_dir);
}
}
- set<string> seen_dirs;
for(const FS::Path &d: resource_dirs)
- if(seen_dirs.insert(d.str()).second)
- {
- argv.push_back("-S");
- argv.push_back(FS::relative(d, work_dir).str());
- }
+ {
+ argv.push_back("-S");
+ argv.push_back(FS::relative(d, work_dir).str());
+ }
return new ExternalTask(argv, work_dir);
}
+#include <msp/core/algorithm.h>
#include "androidapplicationcomponent.h"
#include "androidmanifestfile.h"
#include "builder.h"
#include "sourcepackage.h"
using namespace std;
+using namespace Msp;
AndroidManifestFile::AndroidManifestFile(Builder &b, const AndroidApplicationComponent &a):
FileTarget(b, a.get_package(), a.get_package().get_temp_directory()/a.get_name()/"AndroidManifest.xml"),
void AndroidManifestFile::add_permission(const string &perm)
{
- permissions.insert(perm);
+ if(!any_equals(permissions, perm))
+ permissions.push_back(perm);
}
#ifndef ANDROIDMANIFESTFILE_H_
#define ANDROIDMANIFESTFILE_H_
-#include <set>
+#include <vector>
#include "filetarget.h"
class AndroidApplicationComponent;
{
private:
SharedLibrary *native_lib;
- std::set<std::string> permissions;
+ std::vector<std::string> permissions;
std::string orientation;
public:
void add_permission(const std::string &);
void set_orientation(const std::string &);
- const std::set<std::string> &get_permissions() const { return permissions; }
+ const std::vector<std::string> &get_permissions() const { return permissions; }
const std::string &get_orientation() const { return orientation; }
};
-#include <set>
#include <msp/core/algorithm.h>
#include <msp/strings/format.h>
#include "buildinfo.h"
+#include <msp/core/algorithm.h>
#include <msp/io/print.h>
#include "logger.h"
void Logger::enable_channel(const string &chan)
{
- enabled_channels.insert(chan);
+ auto i = lower_bound(enabled_channels, chan);
+ if(i==enabled_channels.end() || *i!=chan)
+ enabled_channels.insert(i, chan);
}
void Logger::disable_channel(const string &chan)
{
- enabled_channels.erase(chan);
+ auto i = lower_bound(enabled_channels, chan);
+ if(i!=enabled_channels.end() && *i==chan)
+ enabled_channels.erase(i);
}
void Logger::log(const string &chan, const string &message) const
{
- if(enabled_channels.count(chan))
+ auto i = lower_bound(enabled_channels, chan);
+ if(i!=enabled_channels.end() && *i==chan)
IO::print("%s\n", message);
}
#ifndef LOGGER_H_
#define LOGGER_H_
-#include <set>
#include <string>
+#include <vector>
class Logger
{
private:
- std::set<std::string> enabled_channels;
+ std::vector<std::string> enabled_channels;
public:
void enable_channel(const std::string &);
#define PACKAGEMANAGER_H_
#include <map>
+#include <set>
#include <string>
#include <vector>
#include <msp/fs/path.h>