summaryrefslogtreecommitdiffstats
path: root/watchlink/rl_str_proc.cc
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-04-29 16:56:56 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-04-29 16:56:56 -0700
commita8726835c9064a1f2c6a261b14c637950abdd2bc (patch)
treefc9add560d1919d3f2c050d3da486038fba9e355 /watchlink/rl_str_proc.cc
parente87f46b4abc10fe3fc59562d6be25fb96bce1970 (diff)
downloadquagga-a8726835c9064a1f2c6a261b14c637950abdd2bc.tar.bz2
quagga-a8726835c9064a1f2c6a261b14c637950abdd2bc.tar.xz
remove watchlink - no longer used
The watchlink daemon is no longer used, so code can be removed. If it is needed for future changes it can be recovered from the source code control system.
Diffstat (limited to 'watchlink/rl_str_proc.cc')
-rw-r--r--watchlink/rl_str_proc.cc90
1 files changed, 0 insertions, 90 deletions
diff --git a/watchlink/rl_str_proc.cc b/watchlink/rl_str_proc.cc
deleted file mode 100644
index e3c67e82..00000000
--- a/watchlink/rl_str_proc.cc
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Module: rl_str_proc.cc
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- */
-#include "rl_str_proc.hh"
-
-using namespace std;
-
-/**
- *
- **/
-StrProc::StrProc(const string &in_str, const string &token)
-{
- string tmp = in_str;
-
- //convert tabs to spaces
- uint32_t pos = 0;
- string tabtospace = " ";
- string::iterator iter = tmp.begin();
- while ((pos = tmp.find("\t", pos)) != string::npos) {
- tmp.replace(pos, 1, tabtospace);
- pos += tabtospace.length();
- }
-
- //remove the cr
- pos = tmp.find("\n");
- if (pos != string::npos) {
- tmp.replace(pos, 1, "");
- }
-
- //now handle the case of the multiple length token
- //note that we are using the '~' as a token internally
- uint32_t start = 0, end;
- while ((start = tmp.find(token, start)) != string::npos) {
- tmp.replace(start, token.length(), "~");
- }
-
-
- while ((start = tmp.find_first_not_of("~")) != string::npos) {
- tmp = tmp.substr(start, tmp.length() - start);
- end = tmp.find_first_of("~");
- _str_coll.push_back(tmp.substr(0, end));
- tmp = tmp.substr(end+1, tmp.length() - end-1);
- if (end == string::npos) {
- break;
- }
- }
-}
-
-/**
- *
- **/
-string
-StrProc::get(int i)
-{
- if (uint32_t(i) >= _str_coll.size()) {
- return string("");
- }
- return _str_coll[i];
-}
-
-/**
- *
- **/
-string
-StrProc::get(int start, int end)
-{
- if (uint32_t(start) >= _str_coll.size()) {
- return string("");
- }
-
- string tmp;
- for (int i = start; (i < end) && (uint32_t(i) < _str_coll.size()); ++i) {
- tmp += _str_coll[i] + " ";
- }
- return tmp.substr(0,tmp.length()-1);
-}
-
-/**
- *
- **/
-vector<string>
-StrProc::get()
-{
- return _str_coll;
-}