forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvtkDocumentReader.h
93 lines (75 loc) · 2.98 KB
/
vtkDocumentReader.h
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*=========================================================================
Program: Visualization Toolkit
Module: vtkDocumentReader.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
the U.S. Government retains certain rights in this software.
-------------------------------------------------------------------------*/
// .NAME vtkDocumentReader - Reads documents into memory for text analysis.
//
// .SECTION Description
// Reads zero-to-many documents into memory, producing a vtkTable suitable
// for use as an input to other VTK text analysis filters.
//
// Parameters:
// "Files": a collection of filesystem paths to be loaded.
//
// Outputs:
// Output port 0: A vtkTable containing "document", "uri", and "content" columns.
//
// The output "document" column will contain a zero-based integer document index;
// "uri" will contain the filepath to the document formatted as a file:// URI;
// "contents" will contain the binary contents of the document.
//
// .SECTION Caveats
// As a workaround, vtkDocumentReader stores the contents of each document
// in the "contents" column, which is a vtkStdString array. Note that the
// contents of a document may actually be binary data, so check the MIME-Type
// before treating the contents as a string.
//
// .SECTION Thanks
// Developed by Timothy M. Shead ([email protected]) at Sandia National Laboratories.
#ifndef __vtkDocumentReader_h
#define __vtkDocumentReader_h
#include <vtkTableAlgorithm.h>
class vtkStdString;
class VTK_TEXT_ANALYSIS_EXPORT vtkDocumentReader :
public vtkTableAlgorithm
{
public:
static vtkDocumentReader* New();
vtkTypeMacro(vtkDocumentReader, vtkTableAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Add a file to be loaded.
void AddFile(const char* file);
void AddFile(const vtkStdString& file);
// Description:
// Clear the list of files to be loaded.
void ClearFiles();
//BTX
protected:
vtkDocumentReader();
~vtkDocumentReader();
virtual int RequestData(
vtkInformation* request,
vtkInformationVector** inputVector,
vtkInformationVector* outputVector);
private:
vtkDocumentReader(const vtkDocumentReader &); // Not implemented.
void operator=(const vtkDocumentReader &); // Not implemented.
friend class vtkPDocumentReader;
void AddFile(const vtkStdString& file, const vtkIdType id);
class Implementation;
Implementation* const Internal;
//ETX
};
#endif // __vtkDocumentReader_h