summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools.c b/tools.c
index 198169f..1adeca3 100644
--- a/tools.c
+++ b/tools.c
@@ -38,6 +38,7 @@
#define AUX_TAGS_PIN_ITEM1_END "</protected>"
#define AUX_TAGS_PIN_END "</pin-plugin>"
+
std::string parseaux(const char *aux)
{
bool founditem = false;
@@ -213,4 +214,20 @@ bool ischaracters(const char *str, const char *mask)
return match;
}
+std::string ExtractAttribute(const char* evDescription, const char* name)
+{
+ std::string attribute;
+
+ if (!evDescription || !name) return attribute;
+
+ std::string description(evDescription);
+ size_t apos = description.find(name);
+ if (apos != std::string::npos) {
+ apos += strlen(name);
+ size_t npos = description.find('\n', apos);
+ attribute = description.substr(apos, npos - apos);
+ }
+ return attribute;
+}
+
// vim:et:sw=2:ts=2: