MCPcopy Create free account
hub / github.com/Qucs/qucs / encode_String

Function encode_String

qucs/mnemo.cpp:59–79  ·  view source on GitHub ↗

This function replaces the LaTeX tags for special characters into its unicode value.

Source from the content-addressed store, hash-verified

57// This function replaces the LaTeX tags for special characters
58// into its unicode value.
59void encode_String(const QString& Input, QString& Output)
60{
61 int Begin = 0, End = 0;
62 struct tSpecialChar *p;
63
64 Output = "";
65 while((Begin=Input.indexOf('\\', Begin)) >= 0) {
66 Output += Input.mid(End, Begin - End);
67 End = Begin++;
68
69 p = SpecialChars;
70 while(p->Unicode != 0) // test all special characters
71 if(Input.mid(Begin).startsWith(p->Mnemonic)) {
72 Output += QChar(p->Unicode);
73 End = Begin + strlen(p->Mnemonic);
74 break;
75 }
76 else p++;
77 }
78 Output += Input.mid(End);
79}
80
81// This function replaces the unicode of special characters
82// by its LaTeX tags.

Callers 3

createAxisLabelsMethod · 0.85
slotApplyMethod · 0.85
DialogMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected