本文整理汇总了C++中VectorMap::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ VectorMap::Get方法的具体用法?C++ VectorMap::Get怎么用?C++ VectorMap::Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VectorMap
的用法示例。
在下文中一共展示了VectorMap::Get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateHostRunDir
void Ide::BuildAndDebug0(const String& srcfile)
{
if(Build()) {
One<Host> h = CreateHostRunDir();
h->ChDir(GetFileFolder(target));
VectorMap<String, String> bm = GetMethodVars(method);
String dbg = bm.Get("DEBUGGER", Null);
if(IsNull(dbg)) {
if(bm.Get("BUILDER", Null) == "MSC71") {
String sln = ForceExt(target, ".sln");
if(GetFileLength(sln) > 0)
h->Launch("devenv \"" + h->GetHostPath(sln) + "\" "
// + "\"" + h->GetHostPath(srcfile) + "\"" //TRC, 2011/09/26: wrong devenv argument
);
else
h->Launch("devenv \"" + h->GetHostPath(target)
//+ "\" \"" + h->GetHostPath(srcfile) //TRC, 2011/09/26: wrong devenv argument
+ "\" /debugexe "
);
return;
}
dbg = "gdb";
}
else
h->Launch('\"' + dbg + "\" \""
// + h->GetHostPath(srcfile) + ' '
+ h->GetHostPath(target) + "\"", true);
}
}
示例2: GetMethodVars
One<Builder> MakeBuild::CreateBuilder(Host *host)
{
SetupDefaultMethod();
VectorMap<String, String> bm = GetMethodVars(method);
String builder = bm.Get("BUILDER", "GCC");
int q = BuilderMap().Find(builder);
if(q < 0) {
PutConsole("Invalid builder " + builder);
ConsoleShow();
return NULL;
}
One<Builder> b = (*BuilderMap().Get(builder))();
b->host = host;
b->compiler = bm.Get("COMPILER", "");
b->include = SplitDirs(GetVar("UPP") + ';' + bm.Get("INCLUDE", "") + ';' + add_includes);
const Workspace& wspc = GetIdeWorkspace();
for(int i = 0; i < wspc.GetCount(); i++) {
const Package& pkg = wspc.GetPackage(i);
for(int j = 0; j < pkg.include.GetCount(); j++)
b->include.Add(SourcePath(wspc[i], pkg.include[j].text));
}
b->libpath = SplitDirs(bm.Get("LIB", ""));
b->debug_options = bm.Get("DEBUG_OPTIONS", "");
b->release_options = bm.Get("RELEASE_OPTIONS", "");
b->release_size_options = bm.Get("RELEASE_SIZE_OPTIONS", "");
b->debug_link = bm.Get("DEBUG_LINK", "");
b->release_link = bm.Get("RELEASE_LINK", "");
b->script = bm.Get("SCRIPT", "");
b->main_conf = !!main_conf.GetCount();
return b;
}
示例3: Load
void defList::Load(String filePath)
{
Clear() ;
path = filePath ;
name = GetFileTitle(path) ;
VectorMap<String,String> ini = LoadIniFile(path) ;
fields = Split(ini.Get("fields", ""), ',' ) ;
CSVParser csv ;
for( int i=0; true; i++)
{
String s = ini.Get("data_" + AsString(i), "") ;
if (s.IsEmpty())
break ;
data.Add(csv.ParseLine(s, fields.GetCount()) ) ;
}
for (int i=0; true; i++)
{
String s = ini.Get("error_" + AsString(i), "") ;
if (s.IsEmpty())
break ;
errors.Add(s) ;
}
// guardamos este como último cargado
theCfg.lastList = path ;
theCfg.Save() ;
}
示例4: Preset
void OutMode::Preset()
{
int q = ide.recent_buildmode.Find(~method);
SyncLock();
if(q < 0) {
VectorMap<String, String> map = GetMethodVars(~method);
debug.linkmode = atoi(map.Get("DEBUG_LINKMODE", "0"));
debug.debug = atoi(map.Get("DEBUG_INFO", "0"));
debug.blitz = MapFlag(map, "DEBUG_BLITZ");
release.linkmode = atoi(map.Get("RELEASE_LINKMODE", "0"));
release.debug <<= 0;
release.blitz = MapFlag(map, "RELEASE_BLITZ");
}
else {
StringStream ss(ide.recent_buildmode[q]);
TargetMode x;
String dummy;
int m;
ss / m;
ss % dummy;
ss / m;
mode = !!m;
ss % x;
debug.Load(x);
ss % x;
release.Load(x);
}
}
示例5: PackagePath
Index<String> MakeBuild::PackageConfig(const Workspace& wspc, int package,
const VectorMap<String, String>& bm, String mainparam,
Host& host, Builder& b, String *target)
{
String packagepath = PackagePath(wspc[package]);
const Package& pkg = wspc.package[package];
Index<String> cfg;
mainparam << ' ' << bm.Get(targetmode ? "RELEASE_FLAGS" : "DEBUG_FLAGS", NULL);
cfg = SplitFlags(mainparam, package == 0, wspc.GetAllAccepts(package));
cfg.FindAdd(bm.Get("BUILDER", "GCC"));
const TargetMode& m = GetTargetMode();
if(targetmode == 0)
cfg.FindAdd("DEBUG");
switch(m.linkmode) {
case 2:
cfg.FindAdd("SO");
case 1:
cfg.FindAdd("SHARED");
}
if(targetmode == 2)
cfg.FindAdd("FORCE_SPEED");
if(targetmode == 3)
cfg.FindAdd("FORCE_SIZE");
int q = m.package.Find(wspc[package]);
if(q >= 0) {
const PackageMode& p = m.package[q];
switch(p.debug >= 0 ? p.debug : m.def.debug) {
case 1: cfg.FindAdd("DEBUG_MINIMAL"); break;
case 2: cfg.FindAdd("DEBUG_FULL"); break;
}
if(!pkg.noblitz && (p.blitz >= 0 ? p.blitz : m.def.blitz))
cfg.FindAdd("BLITZ");
}
else {
switch(m.def.debug) {
case 1: cfg.FindAdd("DEBUG_MINIMAL"); break;
case 2: cfg.FindAdd("DEBUG_FULL"); break;
}
if(!pkg.noblitz && m.def.blitz)
cfg.FindAdd("BLITZ");
}
host.AddFlags(cfg);
b.AddFlags(cfg);
for(int i = 0; i < pkg.flag.GetCount(); i++) {
if(MatchWhen(pkg.flag[i].when, cfg.GetKeys()))
cfg.Add(pkg.flag[i].text);
}
if(target)
*target = Gather(pkg.target, cfg.GetKeys(), true);
return cfg;
}
示例6: benchmark_VectorMap
void benchmark_VectorMap(const Vector<T>& key, const Vector<T>& fkey, int count)
{
StopTime();
cout << count << " items\n";
{
int i;
VectorMap<T, int> map;
StopTime();
for(i = 0; i < count; i++)
map.Add(key[i], i);
cout << "Adding done in " << StopTime() << " s\n";
for(int j = 0; j < 2; j++) {
for(i = 0; i < count; i++)
if(map.Get(fkey[i]) != i) {
cout << "ERROR !\n";
abort();
}
cout << "Search done in " << StopTime() << " s\n";
}
for(i = 0; i < count; i++)
map.UnlinkKey(key[i]);
cout << "Unlinking done in " << StopTime() << " s\n";
for(i = 0; i < count; i++)
map.Put(key[i], i);
cout << "Putting done in " << StopTime() << " s\n";
}
}
示例7: OutDir
String MakeBuild::OutDir(const Index<String>& cfg, const String& package, const VectorMap<String, String>& bm,
bool use_target)
{
Index<String> excl;
excl.Add(bm.Get("BUILDER", "GCC"));
excl.Add("MSC");
LocalHost().AddFlags(excl);
Vector<String> x;
bool dbg = cfg.Find("DEBUG_FULL") >= 0 || cfg.Find("DEBUG_MINIMAL") >= 0;
if(cfg.Find("DEBUG") >= 0) {
excl.Add("BLITZ");
if(cfg.Find("BLITZ") < 0)
x.Add("NOBLITZ");
}
else
if(dbg)
x.Add("RELEASE");
if(use_target)
excl.Add("MAIN");
for(int i = 0; i < cfg.GetCount(); i++)
if(excl.Find(cfg[i]) < 0)
x.Add(cfg[i]);
Sort(x);
for(int i = 0; i < x.GetCount(); i++)
x[i] = InitCaps(x[i]);
String outdir = GetVar("OUTPUT");
if(output_per_assembly)
outdir = AppendFileName(outdir, GetVarsName());
if(!use_target)
outdir = AppendFileName(outdir, package);
outdir = AppendFileName(outdir, GetFileTitle(method) + "." + Join(x, "."));
outdir = Filter(outdir, CharFilterSlash);
return outdir;
}
示例8: THISBACK
// do setup work here
Options::Options()
{
CtrlLayout(*this,"Options");
Icon(OptionsImg::Options());
// set callback for the save button
btnSave <<= THISBACK(onbtnSave);
// get the values from the config file
VectorMap<String, String> cfg = LoadIniFile(cfgfile);
int dontsplash = ScanInt(cfg.Get("Splash", Null));
int savewinpos = ScanInt(cfg.Get("SaveWinPos", Null));
// set option controls with current value from config file
optSplash = dontsplash;
optSaveWinPos = savewinpos;
}
示例9: BuildAndDebug
void Ide::BuildAndDebug(bool runto)
{
VectorMap<String, String> bm = GetMethodVars(method);
String builder = bm.Get("BUILDER", "");
if(!Build())
return;
if(!FileExists(target))
return;
if(designer)
EditAsText();
One<Host> host = CreateHostRunDir();
host->ChDir(Nvl(rundir, GetFileFolder(target)));
HideBottom();
editor.Disable();
#ifdef COMPILER_MSC
if(builder == "GCC")
if(gdbSelector)
debugger = Gdb_MI2Create(host, target, runarg);
else
debugger = GdbCreate(host, target, runarg);
else
debugger = PdbCreate(host, target, runarg);
#else
if(gdbSelector)
debugger = Gdb_MI2Create(host, target, runarg);
else
debugger = GdbCreate(host, target, runarg);
#endif
if(!debugger) return;
debuglock = 0;
const Workspace& wspc = IdeWorkspace();
for(int i = 0; i < wspc.GetCount(); i++) {
const Package& pk = wspc.GetPackage(i);
String n = wspc[i];
for(int i = 0; i < pk.file.GetCount(); i++) {
String file = SourcePath(n, pk.file[i]);
LineInfo& ln = Filedata(file).lineinfo;
for(int i = 0; i < ln.GetCount(); i++) {
LineInfoRecord& lr = ln[i];
if(!lr.breakpoint.IsEmpty())
if(!debugger->SetBreakpoint(file, lr.lineno, lr.breakpoint)) {
lr.breakpoint = "\xe";
if(PathIsEqual(file, editfile))
editor.SetBreakpoint(lr.lineno, "\xe");
}
}
}
}
SetBar();
editor.Enable();
if(runto) {
if(!debugger->RunTo())
IdeEndDebug();
}
else
debugger->Run();
}
示例10: SetupDefaultMethod
void Ide::SetupDefaultMethod()
{
if(IsNull(method)) {
SetMethod(GetDefaultMethod());
if(IsNull(method)) {
FindFile ff(ConfigFile("*.bm"));
if(!ff)
return;
SetMethod(GetFileTitle(ff.GetName()));
}
VectorMap<String, String> map = GetMethodVars(method);
debug.linkmode = atoi(map.Get("DEBUG_LINKMODE", "0"));
debug.def.debug = atoi(map.Get("DEBUG_INFO", "0"));
debug.def.blitz = MapFlag(map, "DEBUG_BLITZ");
release.linkmode = atoi(map.Get("RELEASE_LINKMODE", "0"));
release.def.debug <<= 0;
release.def.blitz = MapFlag(map, "RELEASE_BLITZ");
}
}
示例11: MenuSetLanguageTo
void GoogleTranslatorDemo::MenuSetLanguageTo(Bar& currentBar, VectorMap<String, String> &cur_parameter) {
bool need_translate = (cur_parameter.Get("NeedTranslate") == "TRUE");
String language_from = cur_parameter.Get("LanguageFrom");
String lang_to = outputwindow.tolanguagectrl.GetKey(outputwindow.tolanguagectrl.GetIndex());
String cur_lang_key;
for(int i = 0; i < languageslist.GetCount(); ++i) {
cur_lang_key = languageslist.GetKey(i);
if(cur_lang_key != language_from) {
if(cur_lang_key == lang_to)
currentBar.Add(languageslist[i], GoogleTranslatorDemoImg::CurrentLang(), THISBACK3(SetLanguageFromToPos, language_from, cur_lang_key, need_translate));
else if (cur_lang_key == languageto)
currentBar.Add(languageslist[i], GoogleTranslatorDemoImg::CurrentTranslatedLang(), THISBACK3(SetLanguageFromToPos, language_from, cur_lang_key, need_translate));
else
currentBar.Add(languageslist[i], THISBACK3(SetLanguageFromToPos, language_from, cur_lang_key, need_translate));
}
}
}
示例12:
G_obj *Get(G_obj *(*widget)())
{
static VectorMap<uintptr_t, G_obj *> wmap;
G_obj *w = wmap.Get((uintptr_t)widget, NULL);
if(!w) {
w = (*widget)();
if(GTK().gtk_widget_get_parent(w) == NULL)
Setup(w);
wmap.Add((uintptr_t)widget, w);
}
return w;
}
示例13: ForceSchemaUpdate
void ForceSchemaUpdate(SqlId table, Fields nf, Fields of, SqlId key, const Value& keyval, Sql& cursor)
{
String tbl;
VectorMap<Id, Value> nmap = GetValueMap(nf, &tbl);
VectorMap<Id, Value> omap = GetValueMap(of);
SqlUpdate update(SqlId(SchemaTableName(Nvl(~table, tbl))));
for(int i = 0; i < nmap.GetCount(); i++)
if(nmap[i] != omap.Get(nmap.GetKey(i), Value()))
update(SqlId(nmap.GetKey(i)), nmap[i]);
if(update)
update.Where(key == keyval).Force(cursor);
}
示例14: XAtom
Atom XAtom(const char *name)
{
GuiLock __;
Atom x;
INTERLOCKED {
static VectorMap<String, int> atoms;
int q = atoms.Get(name, Null);
if(IsNull(q)) {
q = XAtomRaw(name);
atoms.Add(name, q);
}
x = q;
}
return x;
}
示例15: Split
Vector<String> Cuprep(const String& m, const VectorMap<String, String>& mac,
const Vector<String>& inc) {
String r;
String q = Filter(m, CasFilter);
const char *s = q;
while(*s)
if(*s == '$') {
String v;
s++;
if(*s == '$') {
r.Cat('$');
s++;
}
else
if(*s == '(') {
s++;
bool pinc = false;
if(*s == '!') {
pinc = true;
s++;
}
for(;;) {
if(*s == ')') {
s++;
break;
}
if(*s == '\0')
break;
v.Cat(*s++);
}
if(pinc)
for(int i = 0; i < inc.GetCount(); i++)
if(inc[i].Find(' '))
r << v << '"' << inc[i] << "\" ";
else
r << v << inc[i] << ' ';
else
r.Cat(mac.Get(v, Null));
}
else
r.Cat('$');
}
else
r.Cat(*s++);
return Split(r, CharFilterEol);
}