Console С# application creating visio diagrams from C++ code.
-
For start app download /DiagramConstructor/bin/Release directory (or whole repo) and run DiagramConstructor.exe
-
Choose code to build diagram (you can copy all file):
- Input cosen code in code converter which can be opened from app console:
- convert it to one single line
- write result file path (optional)
- and input converted code in console
- Look for .vsdx file in inputed file path or default documents folder of your PC.
-
You need licensed or cracked Visio (you can try run visioActivator.cmd in root of this repo with admin rights to get license).
-
Then simpler and cleaner the code you wrote, the easier it is to create a diagram.
-
Use only english words in code (even in comments).
-
Code to input in console must be converted (no spaces, tabs and line breaks):
- String code = "";
- if (test)
- {
- code = "test code";
- }
- app.RunApp(code);
+ Stringcode='';if(test){code='';}app.RunApp(code);
- Use common "for" instead "foreach"
- foreach(SomeType value in array) {}
+ for(int i = 0; i < array.length; i++) {}
- Use parentheses even for single line code blocks:
- if(a > 10)
- a = 10;
- else
- a = 0;
- for(int i = 0; i < 10; i++)
- count++;
+ if(a > 10)
+ {
+ a = 10;
+ }
+ else
+ {
+ a = 0;
+ }
+ for(int i = 0; i < 10; i++)
+ {
+ count++;
+ }
- Don't use '{' , '}' and ';' chars in code as parts of strings;
- String myString = "if(a == 0) { int a = 10; }";
- Don't use too complex "if" constructions
- if(a == 10)
- {
- if(b == 20)
- {
- if(c == 0)
- {
- c == 0;
- }
- }
- else
- {
- b = 100;
- }
- }
- else
- {
- a = 0;
- }
- Use only standart "else if" form:
- if(a == 10)
- {
- a--;
- }
- else
- {
- if(a == 20)
- {
- a--;
- }
+ if(a == 10)
+ {
+ a--;
+ }
+ else if(a == 20)
+ {
+ a--;
+ }
-
"Break" and "continue" - they will be placed as PROCESS blocks
-
"switch" - use "else if" instead of it
From this code:
#include <iostream>
using namespace std;
main()
{
int a = 10;
for (int i = 0; i < a; i++)
{
if (a * 2 == 4)
{
cout << "some output";
}
else
{
cout << "othet output";
}
}
}
doSome(int a, int b)
{
if(a > b)
{
while(a != b)
{
a--;
}
}
else
{
while (a != b)
{
b--;
}
}
cout << "justice";
}
you can get this diagram:
Send all bugs and errors (with console screen, inputed code and result diagram) in "issues" section of this repository.