ICF 3.0.5.47
Technical documentation of ICF Libraries
CFileTypeInfoComp.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#pragma once
7
8
9// ICF includes
11#include <ifile/IFileTypeInfo.h>
12
13
14namespace ifile
15{
16
17
23 virtual public ifile::IFileTypeInfo
24{
25public:
27
28 I_BEGIN_COMPONENT(CFileTypeInfoComp);
29 I_REGISTER_INTERFACE(ifile::IFileTypeInfo);
30 I_ASSIGN_MULTI_0(m_fileExtensionsAttrPtr, "FileExtensions", "List of supported file extensions", false);
31 I_ASSIGN_MULTI_0(m_typeDescriptionsAttrPtr, "TypeDescriptions", "List of descriptions for each extension", false);
32 I_ASSIGN_MULTI_0(m_fileExtensionsWinAttrPtr, "FileExtensionsWin", "List of supported file extensions for Windows systems only", false);
33 I_ASSIGN_MULTI_0(m_typeDescriptionsWinAttrPtr, "TypeDescriptionsWin", "List of descriptions for each extension for Windows systems only", false);
34 I_ASSIGN_MULTI_0(m_fileExtensionsMacAttrPtr, "FileExtensionsMac", "List of supported file extensions for MAC systems only", false);
35 I_ASSIGN_MULTI_0(m_typeDescriptionsMacAttrPtr, "TypeDescriptionsMac", "List of descriptions for each extension for MAC systems only", false);
36 I_ASSIGN_MULTI_0(m_fileExtensionsUnxAttrPtr, "FileExtensionsUnx", "List of supported file extensions for Unix-type systems only (without MAC)", false);
37 I_ASSIGN_MULTI_0(m_typeDescriptionsUnxAttrPtr, "TypeDescriptionsUnx", "List of descriptions for each extension for Unix-type systems only (without MAC)", false);
38 I_END_COMPONENT;
39
40 // reimplemented (ifile::IFileTypeInfo)
41 bool GetFileExtensions(QStringList& result, const istd::IChangeable* dataObjectPtr = nullptr, int flags = -1, bool doAppend = false) const override;
42 QString GetTypeDescription(const QString* extensionPtr = nullptr) const override;
43
44private:
45 I_MULTIATTR(QString, m_fileExtensionsAttrPtr);
46 I_MULTITEXTATTR(m_typeDescriptionsAttrPtr);
47 I_MULTIATTR(QString, m_fileExtensionsWinAttrPtr);
48 I_MULTITEXTATTR(m_typeDescriptionsWinAttrPtr);
49 I_MULTIATTR(QString, m_fileExtensionsMacAttrPtr);
50 I_MULTITEXTATTR(m_typeDescriptionsMacAttrPtr);
51 I_MULTIATTR(QString, m_fileExtensionsUnxAttrPtr);
52 I_MULTITEXTATTR(m_typeDescriptionsUnxAttrPtr);
53};
54
55
56} // namespace ifile
57
58
Base class for component implementation.
Simple implementation of ifile::IFileTypeInfo using user defined extension list and descriptions.
icomp::CComponentBase BaseClass
bool GetFileExtensions(QStringList &result, const istd::IChangeable *dataObjectPtr=nullptr, int flags=-1, bool doAppend=false) const override
Get file extensions supported by this loader.
QString GetTypeDescription(const QString *extensionPtr=nullptr) const override
Get description of object type associated with single extension.
Provide loading and saving of objects.
Common interface for data model objects, which can be changed.
Definition IChangeable.h:32
#define I_MULTITEXTATTR(member)
Declare translatable multiple text attribute member.
Contains interfaces and implementations of file system related components.

© Witold Gantzke and Kirill Lepskiy