SDSL: Succinct Data Structure Library
A C++ template library for succinct data structures
 All Classes Namespaces Files Functions Variables Typedefs Friends
Static Public Member Functions
sdsl::file Class Reference

A helper class to handle files. More...

#include <testutils.hpp>

List of all members.

Static Public Member Functions

static uint64_t read_text (const char *file_name, char *&c, bool trunc=0, uint64_t lim=0)
 Read the file with the given file_name.
static void write_text (const char *file_name, const char *c, uint64_t len)

Detailed Description

A helper class to handle files.


Member Function Documentation

static uint64_t sdsl::file::read_text ( const char *  file_name,
char *&  c,
bool  trunc = 0,
uint64_t  lim = 0 
) [static]

Read the file with the given file_name.

Parameters:
file_nameThe file name of the text to read.
cA char pointer which will point to the text that was read. New memory is allocated for the text. So free c if read_text was successful and c is not needed anymore.
truncIndicated if the file should be truncated.
limMaximal number of bytes which are read when trunc is true.
Returns:
len The number of read bits. If this is zero, now memory is allocated for c. And c equals NULL.
Precondition:
c has to be initialized to NULL.
Postcondition:
If len > 0 c[len]=0 and the memory for c was allocated with "new" else c=NULL.

The documentation for this class was generated from the following file: