Format Converter (Delphi)
Format converter (JSON, XML, etc.) for Delphi.
Format Converter (JSON, XML, etc.) For Delphi.
Index
- Installation/Configuration
- Use
- Sitemap
- Structure
- Workgroup
- Dependencies
- Contribute
- Checklist to contribute
- Credits
- License
- Code Standardization
- All
- Project Tree
Installation/Configuration

* Click on the image to view the video
Correction: Replace "$ (variable_created) DCU" with "$ (variable_created) Output" on Library Path
Use
How to use

* Click on the image to view the video
Use Example

* Click on the image to view the video
Funds
Jsontoxml
- Stringstring: Converts a string -shaped json into a string shaped XML (string);
- Parameterization
- STRCONTENT: JSON to converter (string);
- Stringtofile: Converts a string json into an XML file (Boolean);
- Parameterization
- STRCONTENT: JSON to converter (string);
- Filepathresult: XML file path to be saved (string);
- Stringtoreturntype: Converts a string -shaped JSON into a TXMLDocument XML (TXMLDocument);
- Parameterization
- STRCONTENT: JSON to converter (string);
- Filestring: Converts an JSON file into an XML in string (string);
- Parameterization
- FILEPATH: JSON file path to converter (string);
- Fileletofile: Converts a JSON file into an XML (Boolean) file;
- Parameterization
- FILEPATH: JSON file path to converter (string);
- Filepathresult: XML file path to be saved (string);
- Fileletoreturntype: Converts a JSON file into an TXMLDocument XML (TXMLDocument);
- Parameterization
- FILEPATH: JSON file path to converter (string);
- OriginintyPetostring: Converts a TJSONOBJECT JSON to a string shaped XML (string);
- Parameterization
- CONTENT: JSON to Converter (TJSONOBJECT);
- Originintypetofile: Converts a TJSONOBJECT JSON to an XML file (Boolean);
- Parameterization
- CONTENT: JSON to Converter (TJSONOBJECT);
- Filepathresult: XML file path to be saved (string);
- Originintypeturntype: Converts a tjsonobject json into a TXMLDocument XML (TXMLDocument);
- Parameterization
- CONTENT: JSON to Converter (TJSONOBJECT);
- Normalizeorigin: converts a string -shaped JSON into a TJSONOBJECT (TJSONOBJECT) JSON;
- Parameterization
- CONTENT: JSON TO NORMALIZE (STRING);
- Normalizeorigin: Converts a TJSonobject json into a tstringlist json (tstringlist);
- Parameterization
- CONTENT: JSON TO NORMALIZE (TJSONOBJECT);
- Normalizeorigin: converts a tstringlist json into a string (string) json;
- Parameterization
- Content: JSON to normalize (TSTRINGLIST);
- Normalizereturn: converts an XML XML XML in the form of TXMLDocument (TXMLDocument);
- Parameterization
- Content: XML to normalize (string);
- Normalizereturn: converts an XMLDocument XML into a TSTRINGLIST XML (TSTRINGLIST);
- Parameterization
- Content: XML to normalize (TXMLDocument);
- Normalizereturn: converts an XML in the shape of a string shaped XML (string);
- Parameterization
- Content: XML to normalize (TSTRINGLIST);
Xmltojson
- Stringstring: converts an XML string XML into a string (string) json;
- Parameterization
- STRCONTENT: XML to Converter (String);
- Stringtofile: converts an XML into string into a JSON file (Boolean);
- Parameterization
- STRCONTENT: XML to Converter (String);
- Filepathresult: JSON file path to be saved (string);
- Stringtoreturntype: Converts an XML string XML into a TJSONOBJECT (TJSONOBJECT) JSON;
- Parameterization
- STRCONTENT: XML to Converter (String);
- Filestring: Converts an XML file into a string (string) json;
- Parameterization
- Filepath: XML file path to converter (string);
- Fileletofile: Convert an XML file into a JSON file (Boolean);
- Parameterization
- Filepath: XML file path to converter (string);
- Filepathresult: JSON file path to be saved (string);
- Fileletoreturntype: Converts an XML file to an TJSONOBJECT JSON (TJSONOBJECT);
- Parameterization
- Filepath: XML file path to converter (string);
- OriginintyPetostring: Converts an XML -shaped XML into a string (string) json;
- Parameterization
- Content: XML to Converter (TXMLDocument);
- Originintypetofile: converts an XML in the form of TXMLDocument into a JSON file (Boolean);
- Parameterization
- Content: XML to Converter (TXMLDocument);
- Filepathresult: JSON file path to be saved (string);
- Originintypeturntype: Converts an XMLDocument XML into a TJSONOBJECT (TJSONOBJECT) JSON;
- Parameterization
- Content: XML to Converter (TXMLDocument);
- Normalizeorigin: converts an XML XML XML in the form of TXMLDocument (TXMLDocument);
- Parameterization
- Content: XML to normalize (string);
- Normalizeorigin: converts an XMLDocument XML into a Tstringlist XML (TSTRINGLIST);
- Parameterization
- Content: XML to normalize (TXMLDocument);
- Normalizeorigin: converts an XML XML into a string shaped XML (string);
- Parameterization
- Content: XML to normalize (TSTRINGLIST);
- Normalizereturn: converts a string -shaped JSON into a TJSONOBJECT (TJSONOBJECT) JSON;
- Parameterization
- CONTENT: JSON TO NORMALIZE (STRING);
- Normalizereturn: Converts a TJSonobject JSON to a Tstringlist (Tstringlist) JSON;
- Parameterization
- CONTENT: JSON TO NORMALIZE (TJSONOBJECT);
- Normalizereturn: Converts a tstringlist json into a string (string) json;
- Parameterization
- Content: JSON to normalize (TSTRINGLIST);
Sitemap

Structure
- APP: Contains the compilation of the package (s) and testator (s);
- Documentation: Contains the documentation of the package (s);
- images: contains the images used in the package (s);
- Modules: Modules that perform each conversion available in the system;
- JSontoxml: Contains the package used for XML conversion to JSON;
- XMLTOJSON: Contains the package used for conversion from JSON to XML;
- Output: Contains the pre -compiled files used by Delphi (.DCU);
- Project: Directory with projects of each package and tester;
- SRC: Contains the essential source for the operation of the package (s);
- Standardization: Contains the interfaces that standardize the pacations;
- Formatconverter: Contains the package with the registration of this component (also used to get the build number);
- FormatConvertester: Contains the executable of the component;
- VERDER: Contains the packets of third parties;
Workgroup
The project compilation must be maintained as in the image.

Dependencies
Contribute
- Make a fork based on the master;
- Make "Commit" of your changes (if you are solving any "ISSUE" do not forget to write "Fixed #numeroissue" in the message);
- Make push of your commits;
- Request a "Pull Request" for the main repository master.
Creating a Issue
To create a Issue pay attention to the following:
- Selecting the suitable label for Issue (this label may be changed, but the non -designation causes the issue to be lost).

- Selecting the Formatconverter - Kanban project, this will organize what is being done and what should be done.

Checklist to contribute
- Test the functionalities created / altered;
- Mark with "#" the issues completed, in the Committs;
- Readme (case in need)
- Build number;
- Change index;
- Change / Add form of use;
- Include packages / classes / methods / parameters in forms of use;
- Change Sitemap;
- Change application structure;
- Updated image of workgroup;
- Add / remove dependencies (third party packages);
- Update package installation / configuration methods;
- Update source documentation;
- Remove / add items in all;
- Update project tree;
- When adding items in all, do not forget to create the corresponding "Issue";
- Main labels
- Bug: correction of some problem;
- Documentation: change in documentation;
- Enhacement: Change of existing functionality to improve it;
- Feature: New functionality;
- Project
- FormatConverter - Kanban: To better organize the project;
Credits
@bomorafinha
License
Code Standardization
Version
To version the formatconverter should be used as a base, the formation of the Formatconverter.BPL packet for Windows 32 bits, as follows:

where:
- Main version, it only changes when basic system operation changes considerably;
- Number of system functional modules;
- Number of public functions available in the system;
- Build version of the Delphi self-generated system;
- Build should be kept as self-increase;
For each test successfully compiled, we must give built on formatconverter.bpl to version (Shift + F9).
Repository releases will be made each time a module is 100% finished, or when a very relevant repair is performed.
Standards adopted in the project
For a better understanding of the project, some standards have been adopted that facilitate the identification of each structure used. They are basically the use of camelcase , and pascalcase ;
Method variables
Local variables must be came camelcase .
Observe the spacing between the variable declaration and the beginning of the method.

Private variables
The Declaration of Private Varyables should always occur within access modifiers.
They must be came camelcase always starting with "f" followed by your name.

Properties
Properties should use Pascalcase .
They must have exactly the name of their private variable and/or access method, eliminating only the prefix (F, Get, Set).

Methods
The declaration of methods should always occur within access modifiers.
Methods must be came camelcase .
The method parameters should be came camelcase starting with "a".
Seek, when possible, use GET , set , EH , etc. according to the method function and/or your return.
When called always use relatives on your call, even when without parameters. Ex: My Memodo ();

Interfaces
Interfaces should always start with the letter "I" (uppercase), followed by their name in Pascalcase .

Classes
Classes should always start with the letter "t", followed by their name in Pascalcase .
Classes that do not extend any other specific classes must extend Tinterfacedobject .

Called methods on multiple lines
Methods with very extensive calls should be called using JSON identity standard.


Use of Begin End Blocks
Structures that do not use the code opening and closing block, such as a line IFs , in a very extensive code they usually get in the way of reading the code for later modifications. For this reason all structures must have the opening and closing block ( Begin .. End )


Idleness
Access modifiers must be declared to be aligned with the class statement.
Declaration of methods, properties, builders/destructive, as well as the variable declaration VAR , must be aligned.
Group procedures and functions without alternating them.
Separate variable declarations, methods, builders, destructors, and properties with a blank line, as well as leave a blank line before the access modifier statement, or the end of the block, except the first modifier after class statement.

Called the internal methods and variables of the class
They must be preceded by the word reserved self to facilitate the reading of the code.

Reserved words
Preference is given to the use of tiny initials for reserved words. However, this is not a rule for the project since being reserved to IDE signals it, thus not disturbing the reading of the code.
File nomenclature
Name the files starting with U_ .
For a better location of files in the file manager, and the units within Delphi, we must set up the name of the files by composing them from their modules, submites, and final function, all separated by point. As follows in the following image:

A well -standardized code is much easier to read, even by programmers who use other languages.
All
JSON CONVERTER -> CSV
- JSON INPUT -> CSV output
- JSON INPUT -> STRING OUTPUT
- JSON INPUT -> File output
- String input -> CSV output
- String input -> String output
- String input -> File output
- File input -> CSV output
- File input -> String output
- File Input -> File output
- Standard Origin String -> JSON
- Standard Origin Json -> TSTRINGLIST
- Standard Origin Tstringlist -> String
- Normalize Return String -> CSV
- Normalize Return CSV -> TSTRINGLIST
- Standard Return TSTRINGLIST -> String
XML Converter -> CSV
- XML input -> CSV output
- XML input -> String output
- XML Input -> File Output
- String input -> CSV output
- String input -> String output
- String input -> File output
- File input -> CSV output
- File input -> String output
- File Input -> File output
- Standard Origin String -> XML
- Standard Origin XML -> TSTRINGLIST
- Standard Origin Tstringlist -> String
- Normalize Return String -> CSV
- Normalize Return CSV -> TSTRINGLIST
- Standard Return TSTRINGLIST -> String
CSV Converter -> JSON
- CSV input -> Output JSON
- CSV input -> String output
- CSV input -> File output
- String input -> JSON output
- String input -> String output
- String input -> File output
- File input -> JSON output
- File input -> String output
- File Input -> File output
- Standard Origin String -> CSV
- Standard Origin CSV -> TSTRINGLIST
- Standard Origin Tstringlist -> String
- Normalize Return String -> JSON
- Normalize Return Json -> TSTRINGLIST
- Standard Return TSTRINGLIST -> String
CSV Converter -> XML
- CSV input -> XML output
- CSV input -> String output
- CSV input -> File output
- String input -> XML output
- String input -> String output
- String input -> File output
- File input -> XML output
- File input -> String output
- File Input -> File output
- Standard Origin String -> CSV
- Standard Origin CSV -> TSTRINGLIST
- Standard Origin Tstringlist -> String
- Normalize Return String -> XML
- Standardize Return XML -> TSTRINGLIST
- Standard Return TSTRINGLIST -> String
Project Tree
FormatConverter
├── app
│ └── .gitkeep
├── documentation
│ └── images
│ ├── exemplo.png
│ ├── install_config.png
│ ├── label_issue.png
│ ├── nomenclatura.png
│ ├── padrao_blocos_01.png
│ ├── padrao_blocos_02.png
│ ├── padrao_chamadas_01.png
│ ├── padrao_chamadas_02.png
│ ├── padrao_classes.png
│ ├── padrao_identacao_01.png
│ ├── padrao_interfaces.png
│ ├── padrao_metodos.png
│ ├── padrao_propriedades.png
│ ├── padrao_self_01.png
│ ├── padrao_variaveis_locais.png
│ ├── padrao_variaveis_privadas.png
│ ├── project_issue.png
│ ├── sitemap.png
│ ├── uso.png
│ ├── versionamento.png
│ └── workgroup.png
├── images
│ └── icone
│ ├── FormatConverter.bmp
│ ├── icon 150x150.png
│ ├── icon 44x44.png
│ ├── icon.ico
│ ├── icon.png
│ └── icon.psd
├── modules
│ ├── CSVtoJSON
│ │ └── U_CSV.JSON.pas
│ ├── CSVtoXML
│ │ └── U_CSV.XML.pas
│ ├── JSONtoCSV
│ │ └── U_JSON.CSV.pas
│ ├── JSONtoXML
│ │ └── U_JSON.XML.pas
│ ├── XMLtoCSV
│ │ └── U_XML.CSV.pas
│ └── XMLtoJSON
│ └── U_XML.JSON.pas
├── output
│ └── .gitkeep
├── project
│ ├── CSVtoJSON.dpk
│ ├── CSVtoJSON.dproj
│ ├── CSVtoXML.dpk
│ ├── CSVtoXML.dproj
│ ├── Format_Converter.groupproj
│ ├── FormatConverter.dpk
│ ├── FormatConverter.dproj
│ ├── FormatConverterTester.dpr
│ ├── FormatConverterTester.dproj
│ ├── JSONtoCSV.dpk
│ ├── JSONtoCSV.dproj
│ ├── JSONtoXML.dpk
│ ├── JSONtoXML.dproj
│ ├── Padronizacao.dpk
│ ├── Padronizacao.dproj
│ ├── XMLtoCSV.dpk
│ ├── XMLtoCSV.dproj
│ ├── XMLtoJSON.dpk
│ └── XMLtoJSON.dproj
├── src
│ ├── FormatConverter
│ │ └── U_FormatConverter.pas
│ ├── FormatConverterTester
│ │ ├── U_FormatConverterTester.View.fmx
│ │ └── U_FormatConverterTester.View.pas
│ └── Padronizacao
│ ├── U_Normalize.pas
│ └── U_Origin.Return.pas
├── vendor
│ └── .gitkeep
├── .gitattributes
├── .gitignore
├── LICENSE
└── README.md