How to parse a C/C++ header file in dart? - flutter

I'm working on a flutter desktop app which should (according to my plan) has the ability to open C/C++ header files (as a plain text) and parse the source code and find all structures and get theirs properties, is there any existing package fits my need, or, maybe I should go with regex instead?

Related

Is it possible to build a LibreOffice document from code similar to the way a web page is built from HTML and CSS?

Is it possible to build a LibreOffice document from code similar to the way a web page is built from HTML and CSS? Can one write an ODF file in which the content and styling are separate, and then/view open in LibreOffice? If so, can one write the code in a text editor as done for HTML/CSS?
There area two reasons I now ask. 1) When I need to make a style change in LibreOffice I have to manually make the same adjustments in a hundred places, such as changing the style of block quotes. 2) I'd like to build documents from a database of text.
I found a question on this in relation to databases but it was about eight years old.
Thank you for any direction you may be able to provide.
Unzip an .odt file that contains styles. You will see two files, content.xml and styles.xml. Edit these files using a text editor and then zip the folder back up to get a modified .odt file.
Be aware that there are two types of styles in the XML files. Named styles are what most people think of as styles, whereas automatic styles are custom formatting, like when you select some text and change the font directly.
The link from tohuwawohu describes utilities to work programmatically with the file. Also as mentioned in the link, it's not too hard to write code yourself. For example in python, import the built-in libraries zipfile and xml.etree.

Is it possible to write a binary file import extension for vs code?

I want to display some informations of a binary file in vs code.
Is it possible to write an extension for vs code, such that when selecting that file in the Explorer (or opening it directly) you see some text extracted from the binary file by that extension?
So the core functionality of that extension would be (simplified) a binary to text converter.
Any suggestions?
The VS Code team member has confirmed they do not have support for registering content providers for binary files in my issue.
I've inspected the workspace.onDidOpenTextDocument and window.onDidChangeActiveTextEditor APIs, but neither seems to be called when opening binary files.
Is there a way to display fallback content using registerTextDocumentContentProvider (or otherwise) for binary files?
That's why these types all carry Text in their names, TextEditor, TextDocument, etc. They can only handle textual, not binary data ;-)
No explanation as to why this works for PDFs, probably special-cased.

Questions regarding language translation using .pot file

I have a .pot file that I wish to translate to a native language and get the final .po file. At this moment, the only plausible option that I have is to open the set of .pot files in a text editor and convert each phrase to the native language.
I would like to know if this can be automated by using some tool/software . I tried POEDIT (in Windows) for converting my .pot file to the native language (Hindi) but it could not perform a single translation. Please provide some inputs.
Thanks
You can use Translator Toolkit provided by Google.
https://translate.google.com/toolkit
(you need a Google account)
Before uploading your file you have to change the file extension to .po so google can accept it.
After translation; download the translated file and use your editor of choice to manage and optimize your translations.

Programmatically convert Doc(x) files to PDF using Microsoft Word

We are developing a Java application that needs to programmatically convert .rtf, .doc and .docx files to PDF files.
Formatting is important to us, so we need the page numbers to be the same between a source file and a target PDF file, and the contents of each page being the same as the original file.
We have tried out open source solutions, such as JODConverter to invoke a LibreOffice of OpenOffice installation, Docx4j and XDocReport. The best formatting was achieved with LibreOffice. However, even in that case, the pages were different (for example, a 87-page .rtf file results in an 80-page PDF file).
So, we think that the ideal way to make the conversion would be to somehow invoke Microsoft Word though our Java application, and make the conversion with it. That would produce PDF files that have the same formatting as the original files.
Is this possible in any of the following ways:
An API that is directly invokeable through Java?
An API that is invokeable through a .Net language and we would use that with something like JACOB?
A 3rd party library that uses a Microsoft Word installation under the hood (something like JODConverter for Word)?
A CLI interface supported by Word (relevant question)?
Something else?

internationalization of an iPhone Application

I am new to iPhone App development (I am using XCode 4.2) and I was wondering if there is a way to translate all the strings , caption etc ... internally without having to translate them one by one .
an idea I have in mind is to use NSUserDefaults to save the language as a global variable and translate everything accordingly
another option is to make a look up table (is it even possible in Objective-C ?)
Thanks
You can use NSLocalizedString(#"<#key#>", #"<#comment#>") and one file (named Localizable.strings( per language. If you use the above function you can use the App Linguan (available on the Mac App Store) to generate the Localizable.strings files.
There is also a command line tool called genstrings that will create the file for you, but believe me that Linguan app will pay for itself in minutes.
You should always add a comment to allow a better translation and to provide context about the key.
You can read a step-by-step tutorial of the process here:
iPhone Localization Tutorial
Here's a high-level overview of the basics (the above tutorial has details):
1) Change all your coded strings to call: NSLocalizedString(#"My text", #"Context for the translator")
2) Export all your strings using the genstrings Terminal command.
3) This creates a text file called Localizable.strings with all your English (source) strings. It looks like this:
/* Context for the translator */
"My text" = "My text";
You send that file to the translators. They'll translate the right side like this: "My text" = "Mi texto";
4) You place each translated Localizable.strings file in its proper language folder: en.lproj, fr.lproj, es.lproj, etc.
When your app loads on the iPhone it will check the user's language settings. If the user has chosen French as the system language, the Localizable.strings inside your fr.lproj folder file will load. If there are any untranslated strings, it just defaults to English (or whatever your source language is) for those.
It's worth following the whole tutorial and note that the file/folder names have to be exact!
Look up the documentation for NSLocalizedString. And how to localize your .xib files (you make localized copies in English.lproj, de.lproj, fr.lproj, etc.).
All you will have to create are the files with the key-value pairs for each language you want to translate and name them accordingly i.e. _en, _fr and so on.
Then all you have to do is send a message to this method:
NSLocalizedString(#"myKey", nil)
And this will return the localized String, in whatever language the current iPhone configuration is.