Slicer 5.6
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkURIHandler.h
Go to the documentation of this file.
1#ifndef __vtkURIHandler_h
2#define __vtkURIHandler_h
3
4// MRML includes
5#include "vtkMRML.h"
7
8// VTK includes
9#include <vtkObject.h>
10
11class VTK_MRML_EXPORT vtkURIHandler : public vtkObject
12{
13public:
15 //static vtkURIHandler *New() { return nullptr; };
16 static vtkURIHandler *New();
17 vtkTypeMacro(vtkURIHandler, vtkObject);
18 void PrintSelf(ostream& os, vtkIndent indent) override;
19
20 vtkGetStringMacro (HostName);
21 vtkSetStringMacro (HostName);
22
26 virtual void StageFileRead ( const char *source, const char * destination );
27 virtual void StageFileWrite ( const char *source, const char * destination );
28
31 virtual void StageFileRead(const char * source,
32 const char * destination,
33 const char *username,
34 const char *password,
35 const char *hostname);
36
37 virtual void StageFileWrite(const char *source,
38 const char *username,
39 const char *password,
40 const char *hostname,
41 const char *sessionID );
42
44
48 virtual int CanHandleURI ( const char * vtkNotUsed(uri) ) { return 0; };
49
52 size_t BufferedWrite ( char *buffer, size_t size, size_t nitems );
53
56 //virtual void SetLocalFile ( std::ofstream * localFile );
57 virtual void SetLocalFile (FILE *localFile);
58
61 int ProgressCallback(FILE* outputFile, double dltotal, double dlnow, double ultotal, double ulnow);
62
63 vtkGetMacro ( RequiresPermission, int );
64 vtkSetMacro ( RequiresPermission, int );
65 vtkGetObjectMacro ( PermissionPrompter, vtkPermissionPrompter );
67 vtkGetStringMacro ( Prefix );
68 vtkSetStringMacro ( Prefix );
69 vtkGetStringMacro ( Name );
70 vtkSetStringMacro ( Name );
71
72 private:
73
74 //--- Methods to configure and close transfer
76 virtual void InitTransfer ( );
77 virtual int CloseTransfer ( )
78 {
79 return 0;
80 }
81
82 int RequiresPermission;
83 vtkPermissionPrompter *PermissionPrompter;
84
85
86 protected:
88 ~vtkURIHandler() override;
91
94 //std::ofstream* LocalFile;
95 FILE *LocalFile;
96 char *Prefix;
97 char *Name;
98 char *HostName;
99
100};
101
102#endif
virtual void SetLocalFile(FILE *localFile)
Use this function to set LocalFile.
int ProgressCallback(FILE *outputFile, double dltotal, double dlnow, double ultotal, double ulnow)
This function gives us some feedback on how our download is going.
virtual void StageFileRead(const char *source, const char *destination, const char *username, const char *password, const char *hostname)
various Read/Write method footprints useful to redefine in specific handlers.
~vtkURIHandler() override
virtual void StageFileWrite(const char *source, const char *username, const char *password, const char *hostname, const char *sessionID)
void PrintSelf(ostream &os, vtkIndent indent) override
virtual void SetPermissionPrompter(vtkPermissionPrompter *prompter)
virtual int CanHandleURI(const char *vtkNotUsed(uri))
need something that goes the other way too...
void operator=(const vtkURIHandler &)
FILE * LocalFile
local file, it gets passed to C functions in the CURL library
static vtkURIHandler * New()
The Usual vtk class functions.
size_t BufferedWrite(char *buffer, size_t size, size_t nitems)
This function writes the downloaded data in a buffered manner.
vtkURIHandler(const vtkURIHandler &)
virtual void StageFileRead(const char *source, const char *destination)
virtual void StageFileWrite(const char *source, const char *destination)