• R/O
  • HTTP
  • SSH
  • HTTPS

qcad: Commit

Source code of QCAD


Commit MetaInfo

Revision2dcdd506cb1570729322a97bc8a6160306912e77 (tree)
Time2015-04-17 11:11:15
AuthorH. Watanabe <kaityo@user...>
CommiterH. Watanabe

Log Message

removes setOutputFilename

Change Summary

Incremental Difference

--- a/compiler/qcrun.cpp
+++ b/compiler/qcrun.cpp
@@ -40,7 +40,7 @@ void forceQuit(void);
4040 void printUsage(void);
4141 void printVersion(void);
4242 void errorAndQuit(const char * const inMessage);
43-std::string setOutputFilename(const std::string &inString);
43+std::string getBaseFilename(const std::string &inString);
4444
4545 //----------------------------------------------------------------------------
4646 /**
@@ -136,7 +136,8 @@ int main(int argc, char **argv) {
136136 //_____ OUTPUT ______
137137 if (isSet(parameters_ready, opt_input)) {
138138 if (false == isSet(parameters_ready, opt_output)) {
139- ofilename = setOutputFilename(ifilename);
139+ //ofilename = setOutputFilename(ifilename);
140+ ofilename = getBaseFilename(ifilename)+".qdt";
140141 }
141142
142143 std::ifstream ifs(ifilename.c_str(), std::ios::in);
@@ -183,6 +184,7 @@ int main(int argc, char **argv) {
183184 }
184185
185186 qBits->SaveToFile(ofilename.c_str());
187+ qBits->SaveAsText("test.txt");
186188 delete qBits;
187189 delete qCCntl;
188190
@@ -293,9 +295,9 @@ void errorAndQuit(const char * const inMessage) {
293295
294296 //----------------------------------------------------------------------------
295297 /**
296- * Set output filename
298+ * get basename of filename
297299 */
298-std::string setOutputFilename(const std::string &inString) {
300+std::string getBaseFilename(const std::string &inString) {
299301 std::string retString = "";
300302
301303 unsigned int posdot = inString.rfind(".", inString.length() - 1);
@@ -305,9 +307,6 @@ std::string setOutputFilename(const std::string &inString) {
305307 } else {
306308 retString.assign(inString, 0, posdot);
307309 }
308-
309- retString += ".qdt";
310-
311310 return retString;
312311 }
313-
312+//----------------------------------------------------------------------------
Show on old repository browser