File: st2ses.cpp

package info (click to toggle)
dtl 1.19-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 424 kB
  • sloc: cpp: 2,214; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 699 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

#include <dtl/dtl.hpp>
#include "common.hpp"
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>

using namespace std;
using namespace dtl;

int main(int argc, char *argv[]){
    
    if (isFewArgs(argc, 2)) {
        cerr << "Too few arguments." << endl;
        return -1;
    }

    typedef string elem;
    typedef vector< string > sequence;

    string s(argv[1]);

    if (!isFileExist(s)) {
        cerr << s << " is invalid." << endl;
        return -1;
    }

    ifstream fs(s.c_str());
    const Ses< elem > ses = Diff< elem, sequence >::composeSesFromStream< ifstream >(fs);
    dtl::Diff< elem, sequence >::printSES(ses);
    
    return 0;
}