API Documentation
Loading...
Searching...
No Matches
FileFormat.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Base
28File: FileFormat
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/File.h>
34#include <NDEVR/UUID.h>
35namespace NDEVR
36{
37 /**----------------------------------------------------------------------------
38 \brief Data that describes a particular file format and how to use the format
39 with the program. Used especially with IOFactory
40
41 ----------------------------------------------------------------------------*/
43 {
44 public:
45 FileFormat(const UUID& id)
46 : file_format_id(id)
47 {}
48
54 bool read_supported = false;
55 bool write_supported = false;
56 bool is_ascii = false;
57 bool operator==(const FileFormat& format) const
58 {
59 return file_format_id == format.file_format_id;
60 }
61 bool operator!=(const FileFormat& format) const
62 {
63 return file_format_id != format.file_format_id;
64 }
69 };
70 /**----------------------------------------------------------------------------
71 \brief A FileRequest bundles format data as well as a particular file.
72
73 ----------------------------------------------------------------------------*/
75 {
77 : format(FileFormat::InvalidFormat())
78 {}
80 : file(file)
81 , format(format)
82 {}
83 bool operator==(const FileRequest& request) const
84 {
85 return file == request.file && format == request.format;
86 }
87 bool operator!=(const FileRequest& request) const
88 {
89 return file != request.file || format != request.format;
90 }
93 };
94
95}
96
Data that describes a particular file format and how to use the format with the program....
Definition FileFormat.h:43
String icon
Definition FileFormat.h:53
bool read_supported
Definition FileFormat.h:54
bool operator==(const FileFormat &format) const
Definition FileFormat.h:57
bool is_ascii
Definition FileFormat.h:56
TranslatedString description
Definition FileFormat.h:50
TranslatedString name
Definition FileFormat.h:49
FileFormat(const UUID &id)
Definition FileFormat.h:45
bool operator!=(const FileFormat &format) const
Definition FileFormat.h:61
String extension
Definition FileFormat.h:52
UUID file_format_id
Definition FileFormat.h:51
bool write_supported
Definition FileFormat.h:55
static FileFormat InvalidFormat()
Definition FileFormat.h:65
Logic for reading or writing to a file as well as navigating filesystems.
Definition File.h:48
The core String class for the NDEVR API.
Definition String.h:69
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
Definition ACIColor.h:37
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233
A FileRequest bundles format data as well as a particular file.
Definition FileFormat.h:75
FileRequest()
Definition FileFormat.h:76
bool operator!=(const FileRequest &request) const
Definition FileFormat.h:87
File file
Definition FileFormat.h:91
FileFormat format
Definition FileFormat.h:92
bool operator==(const FileRequest &request) const
Definition FileFormat.h:83
FileRequest(const File &file, const FileFormat &format)
Definition FileFormat.h:79