本文整理汇总了C++中VectorMap类的典型用法代码示例。如果您正苦于以下问题:C++ VectorMap类的具体用法?C++ VectorMap怎么用?C++ VectorMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VectorMap类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Clear
void defMsg::Load( String filePath )
{
Clear() ;
path = filePath ;
name = GetFileTitle(path) ;
VectorMap<String,String> ini = LoadIniFile(path) ;
from = ini.Get("from") ;
subject = ini.Get("subject") ;
String s ;
for (int i = 0; true; i++)
{
s = ini.Get("body" + AsString(i), "") ;
if (s.IsEmpty())
break ;
qtfBody += s + "\r\n" ;
}
// guardamos este como último cargado
theCfg.lastMsg = path ;
theCfg.Save() ;
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:25,代码来源:cfg.cpp
示例2:
VectorMap<String, Value> Pdb::DataMap(const ArrayCtrl& a)
{
VectorMap<String, Value> r;
for(int i = 0; i < a.GetCount(); i++)
r.Add(a.Get(i, 0), a.Get(i, 1));
return r;
}
开发者ID:guowei8412,项目名称:upp-mirror,代码行数:7,代码来源:Data.cpp
示例3: PromptOK
void OutMode::CmdOptions()
{
const Workspace& wspc = ide.IdeWorkspace();
int pi = wspc.GetCount() > 0 ? 0 : -1;
if (pi < 0) {
PromptOK("No main package");
return;
}
VectorMap<String, String> bm = ide.GetMethodVars(~method);
if (bm.GetCount() == 0) {
PromptOK("Invalid build method");
return;
}
One<Host> host = ide.CreateHost(false);
One<Builder> b = ide.CreateBuilder(~host);
const String& p = wspc[pi];
String output = NativePath(ide.OutDir(ide.PackageConfig(wspc, pi, bm, ~config, *host, *b), p, bm, true));
if (output.Right(1) == ".")
output = output.Left(output.GetCount() - 1);
const ModePane& pane = ~mode == 0 ? debug : release;
int blitzpackage = pane.package.Get(0, 2);
bool blitzbuild = !wspc.package[pi].noblitz && pane.blitz
&& (IsNull(blitzpackage) ? true : blitzpackage);
CmdBuildOptionsWindow window(p, ~method, ~config, output,
~mode, ide.hydra1_threads, pane.linkmode, blitzbuild, pane.map, ide.console.verbosebuild);
LoadFromGlobal(window, "CmdBuildOptionsWindow");
window.GenerateCmd();
window.Run();
StoreToGlobal(window, "CmdBuildOptionsWindow");
}
开发者ID:guowei8412,项目名称:upp-mirror,代码行数:30,代码来源:OutputMode.cpp
示例4: SyncLock
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);
}
}
开发者ID:guowei8412,项目名称:upp-mirror,代码行数:28,代码来源:OutputMode.cpp
示例5: GetClipboardFormatCode
int GetClipboardFormatCode(const char *format_id)
{
GuiLock ___;
int x = (int)(intptr_t)format_id;
if(x >= 0 && x < 65535)
return x;
String fmt = format_id;
if(fmt == "text")
return CF_TEXT;
if(fmt == "wtext")
return CF_UNICODETEXT;
if(fmt == "dib")
return CF_DIB;
if(fmt == "files")
return CF_HDROP;
static StaticMutex m;
Mutex::Lock __(m);
static VectorMap<String, int> format_map;
int f = format_map.Find(format_id);
if(f < 0) {
f = format_map.GetCount();
format_map.Add(format_id,
#ifdef PLATFORM_WINCE
::RegisterClipboardFormat(ToSystemCharset(format_id))
#else
::RegisterClipboardFormat(format_id)
#endif
);
}
return format_map[f];
}
开发者ID:guowei8412,项目名称:upp-mirror,代码行数:31,代码来源:Win32Clip.cpp
示例6: GetAllFacesSys
Vector<FaceInfo> GetAllFacesSys()
{
VectorMap<String, FaceInfo> list;
sList = &list;
list.Add("STDFONT").name = "STDFONT";
list.Top().info = 0;
#ifdef PLATFORM_WINCE
HDC hdc = CreateDC(NULL, NULL, NULL, NULL);
Win32_ForceFace(hdc, "Tahoma", NULL);
Win32_ForceFace(hdc, "Tahoma", "Tahoma");
Win32_ForceFace(hdc, "Courier New", "Tahoma");
Win32_ForceFace(hdc, "Tahoma", "Tahoma");
Win32_ForceFace(hdc, "Tahoma", "Tahoma");
Win32_ForceFace(hdc, "Tahoma", "Tahoma");
#else
HDC hdc = CreateIC("DISPLAY", NULL, NULL, NULL);
Win32_ForceFace(hdc, "Times New Roman", "Arial");
Win32_ForceFace(hdc, "Arial", "Arial");
Win32_ForceFace(hdc, "Courier New", "Arial");
Win32_ForceFace(hdc, "Symbol", "Arial");
Win32_ForceFace(hdc, "WingDings", "Arial");
Win32_ForceFace(hdc, "Tahoma", "Arial");
#endif
Win32_EnumFace(hdc, NULL);
DeleteDC(hdc);
return list.PickValues();
}
开发者ID:koz4k,项目名称:soccer,代码行数:27,代码来源:FontWin32.cpp
示例7: BenchNTL2
void BenchNTL2(const char *file, Stream& out) {
FileIn in(file);
if (!in) {
out << "Cannot open input file.\n";
return;
}
VectorMap<String, int> map;
for(;;) {
int c = in.Get();
if(c < 0) break;
if(IsAlpha(c) || c == '_') {
String id;
id.Cat(c);
c = in.Get();
while(c >= 0 && (IsAlNum(c) || c == '_')) {
id.Cat(c);
c = in.Get();
}
map.GetAdd(id, 0)++;
}
else
if(IsDigit(c))
do c = in.Get();
while(c >= 0 && (IsAlNum(c) || c == '.'));
}
Vector<int> order = GetSortOrder(map.GetKeys());
for(int i = 0; i < order.GetCount(); i++)
out << ~map.GetKey(order[i]) << ": " << map[order[i]] << '\n';
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:32,代码来源:AllMaps.cpp
示例8: SetTransform
void SetTransform(const btTransform& aT, VectorMap<void*, int>& set){
if (set.Find(mSelf) != set.end())
return;
mSelf->setWorldTransform(aT);
mSelf->clearForces();
set[mSelf] = 1;
if (mGameFlag != 0)
Logger::Log(FB_DEFAULT_LOG_ARG, FormatString("(info) Setting rigid body transform for %d", mGameFlag).c_str());
auto numConstraints = mSelf->getNumConstraintRefs();
for (int i = 0; i < numConstraints; ++i){
auto con = mSelf->getConstraintRef(i);
auto conType = con->getConstraintType();
if (conType == FIXED_CONSTRAINT_TYPE || conType == D6_SPRING_2_CONSTRAINT_TYPE){
btFixedConstraint* fixedCon = (btFixedConstraint*)con;
auto a = &con->getRigidBodyA();
auto b = &con->getRigidBodyB();
auto trA = fixedCon->getFrameOffsetA();
auto trB = fixedCon->getFrameOffsetB();
if (b->getUserPointer() == mSelf){
std::swap(a, b);
std::swap(trA, trB);
}
auto bT = aT * trA * trB.inverse();
auto rigidBodyImpl = (RigidBodyImpl*)b->getUserPointer();
rigidBodyImpl->mImpl->SetTransform(bT, set);
}
}
mSelf->activate();
}
开发者ID:wangscript,项目名称:fastbirdEngine,代码行数:29,代码来源:RigidBodyImpl.cpp
示例9: 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";
}
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:27,代码来源:mapbench.cpp
示例10: 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);
}
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:29,代码来源:Debug.cpp
示例11: LoadVarFile
bool LoadVarFile(const char *name, VectorMap<String, String>& _var)
{
try {
VectorMap<String, String> var;
String env = LoadFile(name);
CParser p(env);
while(!p.IsEof()) {
String v = p.ReadId();
p.Char('=');
if(p.IsString())
var.GetAdd(v) = p.ReadString();
else {
String ln;
while(p.PeekChar() != '\r' && p.PeekChar() != '\n' && p.PeekChar() != ';')
ln.Cat(p.GetChar());
var.GetAdd(v) = ln;
p.Spaces();
}
p.Char(';');
}
_var = pick(var);
return true;
}
catch(...) {
return false;
}
}
开发者ID:kolyden,项目名称:mirror,代码行数:27,代码来源:Workspace.cpp
示例12: SaveVarFile
bool SaveVarFile(const char *filename, const VectorMap<String, String>& var)
{
FileOut out(filename);
for(int i = 0; i < var.GetCount(); i++)
out << var.GetKey(i) << " = " << AsCString(var[i]) << ";\n";
out.Close();
return !out.IsError();
}
开发者ID:kolyden,项目名称:mirror,代码行数:8,代码来源:Workspace.cpp
示例13: SEGgradientInPsi
void SEGgradientInPsi(const VectorMap& psi, const deformableImage& I0, const Vector &ps, VectorMap &b, vector<_real> &resol)
{
Vector I ;
psi.multilinInterp(I0.img(), I) ;
psi.multilinInterpGradient(I0.img(), b) ;
b *= I ;
b*= ps ;
}
开发者ID:saurabh-jain,项目名称:registration,代码行数:8,代码来源:shootingSEG.cpp
示例14: validateCustomizationString
bool ImageDesignManager::validateCustomizationString(CustomizationVariables* data, const String& appearanceFilename, int skillLevel) {
VectorMap<String, Reference<CustomizationVariable*> > variables;
variables.setNullValue(NULL);
AssetCustomizationManagerTemplate::instance()->getCustomizationVariables(appearanceFilename.hashCode(), variables, false);
if (variables.size() == 0) {
instance()->error("no customization data found for " + appearanceFilename);
return false;
}
for (int i = 0; i < data->size(); ++i) {
uint8 id = data->elementAt(i).getKey();
int16 val = data->elementAt(i).getValue();
String name = CustomizationIdManager::instance()->getCustomizationVariable(id);
//instance()->info("validating " + name + " with value " + String::valueOf(val), true);
CustomizationVariable* customizationVariable = variables.get(name).get();
if (customizationVariable == NULL) {
instance()->error("customization variable id " + String::valueOf(id) + " not found in the appearance file " + appearanceFilename + " with value " + String::valueOf(val));
continue;
}
PaletteColorCustomizationVariable* palette = dynamic_cast<PaletteColorCustomizationVariable*>(customizationVariable);
if (palette != NULL) {
if (!validatePalette(palette, val, skillLevel))
return false;
} else {
BasicRangedIntCustomizationVariable* range = dynamic_cast<BasicRangedIntCustomizationVariable*>(customizationVariable);
if (range == NULL) {
instance()->error("unkown customization variable type " + name);
return false;
} else {
int maxExcl = range->getMaxValueExclusive();
int minIncl = range->getMinValueInclusive();
if (val >= maxExcl || val < minIncl) {
instance()->error("variable outside bounds " + name + " value " + val + " outside bounds [" + String::valueOf(minIncl) + "," + String::valueOf(maxExcl) + ")");
return false;
} else {
//instance()->info("variable " + name + " value " + String::valueOf(val) + " inside bounds [" + String::valueOf(minIncl) + "," + String::valueOf(maxExcl) + ")", true);
}
}
}
//info("setting variable:" + name + " to " + String::valueOf(val), true);
}
return true;
}
开发者ID:Marott1,项目名称:Core3,代码行数:58,代码来源:ImageDesignManager.cpp
示例15: DataMap
VectorMap<String, String> DataMap(const ArrayCtrl& data)
{
GuiLock __;
VectorMap<String, String> m;
for(int i = 0; i < data.GetCount(); i++)
m.Add(data.Get(i, 0), data.Get(i, 1));
return m;
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:9,代码来源:GdbCmd.cpp
示例16: GetMethodVars
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();
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:57,代码来源:Debug.cpp
示例17: canAddObject
int SaberInventoryContainerComponent::canAddObject(SceneObject* sceneObject, SceneObject* object, int containmentType, String& errorDescription) {
ManagedReference<SceneObject*> p = sceneObject->getParent();
if (p != NULL){
int containment = p->getContainmentType();
if (containment == 4){
errorDescription = "@jedi_spam:saber_not_while_equpped";
return TransferErrorCode::INVALIDTYPE;
}
}
if (!object->isLightsaberCrystalObject()) {
errorDescription = "@jedi_spam:saber_not_crystal";
return TransferErrorCode::INVALIDTYPE;
}
LightsaberCrystalComponent* crystal = cast<LightsaberCrystalComponent*> (object);
if (crystal->getOwner() == ""){
errorDescription = "@jedi_spam:saber_crystal_not_tuned";
return TransferErrorCode::INVALIDTYPE;
}
ManagedReference<CreatureObject*> creature = cast<CreatureObject*>(object->getParent().get().get());
if (creature != NULL && crystal->getOwner() != creature->getDisplayedName()){
errorDescription = "@jedi_spam:saber_crystal_not_owner";
return TransferErrorCode::INVALIDTYPE;
}
if (crystal->isDestroyed()) {
errorDescription = "You cannot add a broken crystal to your lightsaber.";
return TransferErrorCode::INVALIDTYPE;
}
VectorMap<uint64, ManagedReference<SceneObject*> >* containerObjects = sceneObject->getContainerObjects();
if (containerObjects->size() >= sceneObject->getContainerVolumeLimit()) {
errorDescription = "@container_error_message:container03"; //This container is full.
return TransferErrorCode::CONTAINERFULL;
}
for (int i = 0; i < containerObjects->size(); i++){
Reference<LightsaberCrystalComponent*> crystalInside = sceneObject->getContainerObject(i).castTo<LightsaberCrystalComponent*>();
if (crystal->getColor() != 31 && crystalInside->getColor() != 31){
errorDescription = "@jedi_spam:saber_already_has_color";
return TransferErrorCode::INVALIDTYPE;
}
}
return 0;
}
开发者ID:Chilastra-Reborn,项目名称:Chilastra-source-code,代码行数:54,代码来源:SaberInventoryContainerComponent.cpp
示例18: Describe
VectorMap<String, SqlColumnInfo> Describe(const SqlVal& table, Sql& cursor)
{
VectorMap<String, SqlColumnInfo> map;
if(cursor * SelectAll().From(table).Where(SqlBool::False()))
for(int i = 0, n = cursor.GetColumns(); i < n; i++)
{
const SqlColumnInfo& sci = cursor.GetColumnInfo(i);
map.Add(sci.name, sci);
}
return map;
}
开发者ID:ultimatepp,项目名称:mirror,代码行数:11,代码来源:util.cpp
示例19:
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;
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:12,代码来源:test.cpp
示例20: SaveImages
void SaveImages(const char *dir, const char *prefix, const VectorMap<String, Image>& img)
{
for(int i = 0; i < img.GetCount(); i++) {
String fn;
if(prefix)
fn << prefix;
Point p1 = img[i].GetHotSpot();
Point p2 = img[i].Get2ndSpot();
fn << img.GetKey(i) << '.' << p1.x << '.' << p1.y << '.' << p2.x << '.' << p2.y << ".png";
PNGEncoder().SaveFile(AppendFileName(dir, fn), img[i]);
}
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:12,代码来源:Theme.cpp
注:本文中的VectorMap类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论