File: write_structure.cpp

package info (click to toggle)
libsdsl 2.1.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,992 kB
  • sloc: cpp: 42,286; makefile: 1,171; ansic: 318; sh: 201; python: 27
file content (23 lines) | stat: -rw-r--r-- 600 bytes parent folder | download | duplicates (17)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <sdsl/suffix_arrays.hpp>
#include <iostream>
#include <fstream>

using namespace sdsl;
using namespace std;

int main()
{
    csa_wt<> csa;
    construct_im(csa, "This is how it works", 1);
    // write only one object to std::cout
    write_structure<HTML_FORMAT>(csa, cout);
    wt_int<> wt;
    construct_im(wt, int_vector<>(1000,3));
    // write multiple objects into one file
    {
        ofstream out("write_structure.html");
        write_structure<HTML_FORMAT>(out, csa, wt);
    }
    // write one object into a file
    write_structure<HTML_FORMAT>(csa, "csa_structure.html");
}