src/ccstruct/boxread.cpp
bool ReadAllBoxes(int target_page, bool skip_blanks, const char *filename, std::vector<TBOX> *boxes,
                  std::vector<std::string> *texts, std::vector<std::string> *box_texts,
                  std::vector<int> *pages) {
  std::ifstream input(BoxFileName(filename).c_str(), std::ios::in | std::ios::binary);
  std::vector<char> box_data(std::istreambuf_iterator<char>(input), {});
  if (box_data.empty()) {
    return false;
  }
  // Convert the array of bytes to a string, so it can be used by the parser.
  box_data.push_back('\0');
  return ReadMemBoxes(target_page, skip_blanks, &box_data[0],
                      /*continue_on_failure*/ true, boxes, texts, box_texts, pages);
}
// Reads all boxes from the given filename.
// Reads a specific target_page number if >= 0, or all pages otherwise.
// Skips blanks if skip_blanks is true.
// The UTF-8 label of the box is put in texts, and the full box definition as
// a string is put in box_texts, with the corresponding page number in pages.
// Each of the output vectors is optional (may be nullptr).
// Returns false if no boxes are found.
Reads all boxes from the given filename.
Reads a specific target_page number if >= 0, or all pages otherwise.
Skips blanks if skip_blanks is true.
The UTF-8 label of the box is put in texts, and the full box definition as
a string is put in box_texts, with the corresponding page number in pages.
Each of the output vectors is optional (may be nullptr).
Returns false if no boxes are found.
Reads all boxes from the given filename . Reads a specific target_page number if > = 0 or all pages otherwise . Skips blanks if skip_blanks is true . The UTF - 8 label of the box is put in texts and the full box definition as a string is put in box_texts with the corresponding page number in pages . Each of the output vectors is optional ( may be nullptr ) . Returns false if no boxes are found .
bool ReadAllBoxes(int target_page, bool skip_blanks, const char *filename, std::vector<TBOX> *boxes,
                  std::vector<std::string> *texts, std::vector<std::string> *box_texts,
                  std::vector<int> *pages) {
  std::ifstream input(BoxFileName(filename).c_str(), std::ios::in | std::ios::binary);
  std::vector<char> box_data(std::istreambuf_iterator<char>(input), {});
  if (box_data.empty()) {
    return false;
  }
  box_data.push_back('\0');
  return ReadMemBoxes(target_page, skip_blanks, &box_data[0],
                       true, boxes, texts, box_texts, pages);
}
bool ReadAllBoxes ( int target_page , bool skip_blanks , const char * filename , std :: vector < TBOX > * boxes , std :: vector < std :: string > * texts , std :: vector < std :: string > * box_texts , std :: vector < int > * pages ) { std :: ifstream input ( BoxFileName ( filename ) . c_str ( ) , std :: ios :: in | std :: ios :: binary ) ; std :: vector < char > box_data ( std :: istreambuf_iterator < char > ( input ) , { } ) ; if ( box_data . empty ( ) ) { return false ; } box_data . push_back ( ' \0 ' ) ; return ReadMemBoxes ( target_page , skip_blanks , & box_data [ 0 ] , true , boxes , texts , box_texts , pages ) ; }
Reads all boxes from the given filename.
Reads all boxes from the given filename .
// Convert the array of bytes to a string, so it can be used by the parser. /*continue_on_failure*/