| 1145 | |
| 1146 | |
| 1147 | bool 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 | |
| 1183 | int initCPP() |
| 1184 | { |
nothing calls this directly
no test coverage detected