MCPcopy Create free account
hub / github.com/bumptop/BumpTop / loadCPP

Function loadCPP

trunk/win/Source/LUpdateString/cpp.cpp:1147–1181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1145
1146
1147bool loadCPP(Translator &translator, QIODevice &dev, ConversionData &cd)
1148{
1149 QString defaultContext = cd.m_defaultContext;
1150
1151 yyCodecIsUtf8 = (translator.codecName() == "UTF-8");
1152 yyForceUtf8 = false;
1153 QTextStream ts(&dev);
1154 QByteArray codecName = cd.m_codecForSource.isEmpty()
1155 ? translator.codecName() : cd.m_codecForSource;
1156 ts.setCodec(QTextCodec::codecForName(codecName));
1157 ts.setAutoDetectUnicode(true);
1158 yySourceCodec = ts.codec();
1159 if (yySourceCodec->name() == "UTF-16")
1160 translator.setCodecName("System");
1161 yySourceIsUnicode = yySourceCodec->name().startsWith("UTF-");
1162 yyInStr = ts.readAll();
1163 yyInPos = 0;
1164 yyFileName = cd.m_sourceFileName;
1165 yyFileName = QFileInfo(yyFileName).fileName();
1166 yySavedBraceDepth.clear();
1167 yySavedParenDepth.clear();
1168 yyBraceDepth = 0;
1169 yyParenDepth = 0;
1170 yyCurLineNo = 1;
1171 yyBraceLineNo = 1;
1172 yyParenLineNo = 1;
1173 yyCh = getChar();
1174
1175 remainingFileString = yyInStr;
1176 lastLineNumber = 1;
1177
1178 parse(&translator, defaultContext, defaultContext);
1179
1180 return true;
1181}
1182
1183int initCPP()
1184{

Callers

nothing calls this directly

Calls 10

codecForNameFunction · 0.85
QFileInfoClass · 0.85
fileNameMethod · 0.80
getCharFunction · 0.70
parseFunction · 0.70
isEmptyMethod · 0.45
nameMethod · 0.45
startsWithMethod · 0.45
readAllMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected