aboutsummaryrefslogtreecommitdiffstats
path: root/rdsparse/rdsparse.cc
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-04-22 16:03:33 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-04-22 16:03:33 +0200
commit322c6d765ab1d83cfb5f201626525d3b139103d0 (patch)
tree8f51b7047cb6ddfee7554c6e3bbd7dc1f9f07f7b /rdsparse/rdsparse.cc
parente5595ed8c96ddbe593f2cc3a62f2de38f2884f49 (diff)
downloadmmbtools-aux-322c6d765ab1d83cfb5f201626525d3b139103d0.tar.gz
mmbtools-aux-322c6d765ab1d83cfb5f201626525d3b139103d0.tar.bz2
mmbtools-aux-322c6d765ab1d83cfb5f201626525d3b139103d0.zip
Delete useless rdsparse
Diffstat (limited to 'rdsparse/rdsparse.cc')
-rw-r--r--rdsparse/rdsparse.cc77
1 files changed, 0 insertions, 77 deletions
diff --git a/rdsparse/rdsparse.cc b/rdsparse/rdsparse.cc
deleted file mode 100644
index 7d9babd..0000000
--- a/rdsparse/rdsparse.cc
+++ /dev/null
@@ -1,77 +0,0 @@
-#include <iostream>
-#include <iomanip>
-#include <fstream>
-#include <vector>
-#include <deque>
-#include "decoder_impl.h"
-#include "parser_impl.h"
-
-#define PTY_LOCALE 0
-
-using namespace std;
-
-rds::parser_impl parser(true, true, PTY_LOCALE);
-rds::decoder_impl decoder(true, true);
-
-void usage()
-{
- std::cerr << "Specify filename" << std::endl;
-}
-
-int main(int argc, char **argv)
-{
- if (argc == 1) {
- usage();
- return 1;
- }
-
- ifstream in_fd;
- in_fd.open(argv[1]);
-
- string temp;
- while (getline(in_fd, temp)) {
- stringstream temp_ss(temp);
- deque<string> elems;
-
- string item;
- char delim = ' ';
- while (getline(temp_ss, item, delim)) {
- elems.push_front(item);
- }
-
- vector<int> bytes;
- for (auto s : elems) {
- int byte = stoul(s, nullptr, 16);
- bytes.push_back(byte);
- }
-
- const int skip_head = 7;
- const int skip_tail = 6;
-
- if (bytes[0] == 0xFD) {
- int length = bytes[1];
-
- vector<int> bits;
-
- if (length > 0) {
-#define HEX(a) std::hex << std::setfill('0') << std::setw(2) << long(a) << std::dec
-
- for (int i = skip_head; i < length+(skip_head - skip_tail); i++) {
- cerr << " " << HEX(bytes[i]);
-
- for (int ix = 0; ix < 8; ix++) {
- bits.push_back(bytes[i] & (1 << ix) ? 1 : 0);
- }
- }
- cerr << " len: " << bits.size() << endl;
-
- decoder.work(bits.size(), &bits[0]);
- }
-
- }
-
- }
-
- return 0;
-}
-