From 2077fd3163afbf00561d4d4030a087ffded67a81 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Tue, 29 Dec 2015 00:14:55 +0000 Subject: [PATCH] Added MapDataExists subroutines for the Contact Editor loading process. --- source/common/textprocessing.cpp | 28 ++++++++++++++++++++++++++++ source/common/textprocessing.h | 3 +++ 2 files changed, 31 insertions(+) diff --git a/source/common/textprocessing.cpp b/source/common/textprocessing.cpp index d4aee6b..d979d30 100644 --- a/source/common/textprocessing.cpp +++ b/source/common/textprocessing.cpp @@ -106,6 +106,34 @@ void DeleteMapDataProcess(int IndexNum, std::map* MapData){ MapData->erase(IndexNum); } +bool MapDataExists(int *ItemIndex, std::map *MapPtr){ + + if (MapPtr->find(*ItemIndex) == MapPtr->end()){ + + return FALSE; + + } else { + + return TRUE; + + } + +} + +bool MapDataExists(int *ItemIndex, std::map *MapPtr){ + + if (MapPtr->find(*ItemIndex) == MapPtr->end()){ + + return FALSE; + + } else { + + return TRUE; + + } + +} + /* template void DeleteMapData(ArgMap* ArgMapPtr, Args*... ArgsList){ diff --git a/source/common/textprocessing.h b/source/common/textprocessing.h index 8461393..78ddf2b 100644 --- a/source/common/textprocessing.h +++ b/source/common/textprocessing.h @@ -35,6 +35,9 @@ void DeleteMapDataProcess(int IndexNum, std::map* MapData); void DeleteMapDataProcess(int IndexNum, std::map* MapData); void DeleteMapDataProcess(int IndexNum, std::map* MapData); +bool MapDataExists(int *ItemIndex, std::map *MapPtr); +bool MapDataExists(int *ItemIndex, std::map *MapPtr); + //void DeleteMapDataB() {}; //void DeleteMapData() {}; -- 2.39.2