コード例 #1
0
//------------------------------------------------------------------------------
std::string ConsoleMessageReceiver::GetLogFileName()
{
   FileManager *fm = FileManager::Instance();
   std::string fname;
   try
   {
      if (logFileName == "")
      {
         fname = fm->GetFullPathname("LOG_FILE");
      }
      else
      {
         std::string outputPath = fm->GetPathname(FileManager::LOG_FILE);
         
         // add output path if there is no path
         if (logFileName.find("/") == logFileName.npos &&
             logFileName.find("\\") == logFileName.npos)
         {
            fname = outputPath + logFileName;
         }
      }
   }
   catch (BaseException &e)
   {
      ShowMessage
         ("**** ERROR **** " + e.GetFullMessage() + 
          "So setting log file name to GmatLog.txt");
      
      fname = "GmatLog.txt";
   }
   
   return fname;
}
コード例 #2
0
ファイル: BANDB.C プロジェクト: LiXT7891/courses
void BANDB::createDB(char* dbName, char* logName) {
	// Create db and log files, start buffer and log managers
	fm->create(dbName);
	fm->create(logName);
	bm->start(dbName);
	lm->start(logName);
}
コード例 #3
0
	bool TextureAtlas::LoadFromFile(const std::string& filePath)
	{
		FileManager fr;
		fr.OpenFile(filePath);

		tinyxml2::XMLDocument doc;
		if (doc.Parse(fr.ReadText().c_str()))
			return false;

		const tinyxml2::XMLElement* element = doc.FirstChildElement();
		m_texture = uthRS.LoadTexture(element->FindAttribute("imagePath")->Value());

        if (!m_texture)
            return false;

		for (const tinyxml2::XMLElement* child = element->FirstChildElement(); child != nullptr; child = child->NextSiblingElement())
		{
			std::string name(child->FindAttribute("name")->Value());
			pmath::Rect rect;

			float x = child->FindAttribute("x")->FloatValue(),
				y = child->FindAttribute("y")->FloatValue();

			rect.position.x = x / m_texture->GetSize().x;
			rect.position.y = y / m_texture->GetSize().y;
			rect.size.x = child->FindAttribute("width")->FloatValue() / m_texture->GetSize().x;
			rect.size.y = child->FindAttribute("height")->FloatValue() / m_texture->GetSize().y;

			m_textureRects.insert(std::make_pair(name, rect));
		}
		return true;
	}
コード例 #4
0
ファイル: CompilerInstance.cpp プロジェクト: colgur/clang
bool CompilerInstance::InitializeSourceManager(llvm::StringRef InputFile,
                                               Diagnostic &Diags,
                                               FileManager &FileMgr,
                                               SourceManager &SourceMgr,
                                               const FrontendOptions &Opts) {
  // Figure out where to get and map in the main file, unless it's already
  // been created (e.g., by a precompiled preamble).
  if (!SourceMgr.getMainFileID().isInvalid()) {
    // Do nothing: the main file has already been set.
  } else if (InputFile != "-") {
    const FileEntry *File = FileMgr.getFile(InputFile);
    if (!File) {
      Diags.Report(diag::err_fe_error_reading) << InputFile;
      return false;
    }
    SourceMgr.createMainFileID(File);
  } else {
    llvm::OwningPtr<llvm::MemoryBuffer> SB;
    if (llvm::MemoryBuffer::getSTDIN(SB)) {
      // FIXME: Give ec.message() in this diag.
      Diags.Report(diag::err_fe_error_reading_stdin);
      return false;
    }
    const FileEntry *File = FileMgr.getVirtualFile(SB->getBufferIdentifier(),
                                                   SB->getBufferSize(), 0);
    SourceMgr.createMainFileID(File);
    SourceMgr.overrideFileContents(File, SB.take());
  }

  assert(!SourceMgr.getMainFileID().isInvalid() &&
         "Couldn't establish MainFileID!");
  return true;
}
コード例 #5
0
int callbackSendChunk(Packet& p)
{
	PacketSendChunk pp (p);

	//cout << "callbackSendChunk";

	// récupérer singleton serveur
	ClientData* cd = PolypeerClient::getInstance()->getClientData();

	Chunk* tmp = pp.getChunk();

	if(tmp->isIntegrate())
    {

    	FileManager* fm = cd->getFileManager(tmp->getIdFile());
        fm->saveChunk(*tmp);

        cd->getConnectionManager()->sendTo(cd->getAddressServ(), PacketChunkReceived(tmp->getIdFile(), fm->getCurrentNumberChunk()));
    }
    else
    {
        //cout << "erreur du Chunk reçu :";
        //cout << tmp->getNumber()<<endl;
        cd->getConnectionManager()->sendTo(cd->getAddressServ(), PacketMd5Error(tmp->getIdFile(), tmp->getNumber()));
    }
	delete tmp;
	return 1;
}
コード例 #6
0
int main()
{
	llvm::raw_stdout_ostream ost;
	//DiagnosticOptions dops;
	TextDiagnosticPrinter tdp(ost);//, dops);
	Diagnostic diag(&tdp);
	LangOptions lang;
	//lang.GNUMode = 1;
	SourceManager sm;
	FileManager fm;
	HeaderSearch headers(fm);
	InitHeaderSearch init(headers);
	init.AddDefaultSystemIncludePaths(lang);
	init.Realize();
	TargetInfo *ti = TargetInfo::CreateTargetInfo(LLVM_HOSTTRIPLE);
	Preprocessor pp(diag, lang, *ti, sm, headers);

	PreprocessorInitOptions ppio;
	InitializePreprocessor(pp, ppio);

	const FileEntry *file = fm.getFile("foo.c");
	sm.createMainFileID(file, SourceLocation());
	pp.EnterMainSourceFile();

	IdentifierTable tab(lang);
	MyAction action(pp);
	Parser p(pp, action);
	p.ParseTranslationUnit();

	return 0;
}
コード例 #7
0
ファイル: lnkproperties.cpp プロジェクト: opieproject/opie
bool LnkProperties::copyFile( DocLnk &newdoc )
{
    const char *linkExtn = ".desktop";
    QString fileExtn;
    int extnPos = lnk->file().findRev( '.' );
    if ( extnPos > 0 )
	fileExtn = lnk->file().mid( extnPos );

    QString safename = newdoc.name();
    safename.replace(QRegExp("/"),"_");

    QString fn = locations[ d->locationCombo->currentItem() ]
		  + "/Documents/" + newdoc.type();
    if (!createMimedir(locations[ d->locationCombo->currentItem() ],newdoc.type())) {
        return FALSE;
    }
    fn+="/"+safename;
    if ( QFile::exists(fn + fileExtn) || QFile::exists(fn + linkExtn) ) {
	int n=1;
	QString nn = fn + "_" + QString::number(n);
	while ( QFile::exists(nn+fileExtn) || QFile::exists(nn+linkExtn) ) {
	    n++;
	    nn = fn + "_" + QString::number(n);
	}
	fn = nn;
    }
    newdoc.setFile( fn + fileExtn );
    newdoc.setLinkFile( fn + linkExtn );

    // Copy file
    FileManager fm;
    if ( !fm.copyFile( *lnk, newdoc ) )
	return FALSE;
    return TRUE;
}
コード例 #8
0
ファイル: JsonImporter.cpp プロジェクト: eparayre/blueprint
std::unique_ptr<Project> JsonImporter::ImportProject(FileManager& fileManager, const filesystem::path& projectFile)
{
    auto json = internal::ParseJsonFile(fileManager.GetFileSystem(), projectFile);

    if (internal::IsValidProject(json))
    {
        auto project = std::make_unique<Project>();

        project->SetName(json["project"]);
        project->SetFile(projectFile);

        for (auto& config : json["configs"])
        {
            project->AddConfiguration(internal::ImportConfig(config));
        }

        for (auto& filePath : json["files"])
        {
            project->AddFile(fileManager.GetOrCreateFile(filePath));
        }

        return project;
    }

    return nullptr;
}
コード例 #9
0
ファイル: mainwindow2.cpp プロジェクト: Forkhere/pencil
bool MainWindow2::saveObject( QString strSavedFileName )
{
    QProgressDialog progress( tr( "Saving document..." ), tr( "Abort" ), 0, 100, this );
    progress.setWindowModality( Qt::WindowModal );
    progress.show();

    FileManager* fm = new FileManager( this );
    Status st = fm->save( mEditor->object(), strSavedFileName );

    progress.setValue( 100 );
    
    if ( !st.ok() )
    {
        return false;
    }

    QSettings settings( PENCIL2D, PENCIL2D );
    settings.setValue( LAST_FILE_PATH, strSavedFileName );

    mRecentFileMenu->addRecentFile( strSavedFileName );
    mRecentFileMenu->saveToDisk();

    mTimeLine->updateContent();

    setWindowTitle( strSavedFileName );

    return true;
}
コード例 #10
0
ファイル: CompilerInstance.cpp プロジェクト: dhlbh/opencor
bool CompilerInstance::InitializeSourceManager(StringRef InputFile,
                                               SrcMgr::CharacteristicKind Kind,
                                               DiagnosticsEngine &Diags,
                                               FileManager &FileMgr,
                                               SourceManager &SourceMgr,
                                               const FrontendOptions &Opts) {
  // Figure out where to get and map in the main file.
  if (InputFile != "-") {
    const FileEntry *File = FileMgr.getFile(InputFile);
    if (!File) {
      Diags.Report(diag::err_fe_error_reading) << InputFile;
      return false;
    }
    SourceMgr.createMainFileID(File, Kind);
  } else {
    OwningPtr<llvm::MemoryBuffer> SB;
    if (llvm::MemoryBuffer::getSTDIN(SB)) {
      // FIXME: Give ec.message() in this diag.
      Diags.Report(diag::err_fe_error_reading_stdin);
      return false;
    }
    const FileEntry *File = FileMgr.getVirtualFile(SB->getBufferIdentifier(),
                                                   SB->getBufferSize(), 0);
    SourceMgr.createMainFileID(File, Kind);
    SourceMgr.overrideFileContents(File, SB.take());
  }

  assert(!SourceMgr.getMainFileID().isInvalid() &&
         "Couldn't establish MainFileID!");
  return true;
}
コード例 #11
0
ファイル: contactlist.cpp プロジェクト: Destidom/Calendar
void ContactList::updateList(QStringList nameList)
{
    FileManager file;
    listWidget->clear();
    listWidget->addItems(nameList);
    file.updateContacts(nameList);
}
コード例 #12
0
ファイル: replaybuilder.cpp プロジェクト: qyqx/BerryBots
char* ReplayBuilder::getResourcePath(const char *resourcePath) {
  if (templateDir_ == 0) {
    return 0;
  }
  FileManager fileManager;
  return fileManager.getFilePath(templateDir_, resourcePath);
}
コード例 #13
0
ファイル: HarmonicField.cpp プロジェクト: rockstorm101/GMAT
//------------------------------------------------------------------------------
HarmonicField::HarmonicField(const std::string &name, const std::string &typeName,
                             Integer maxDeg, Integer maxOrd) :
    GravityBase             (typeName, name),
    hMinitialized           (false),
    maxDegree               (maxDeg),
    maxOrder                (maxOrd),
    degree                  (4),
    order                   (4),
    filename                (""),
    filenameFullPath        (""),
    fileRead                (false),
    usingDefaultFile        (false),
    isFirstTimeDefault      (true),
    inputCSName             ("EarthMJ2000Eq"),
    fixedCSName             ("EarthFixed"),
    targetCSName            ("EarthMJ2000Eq"),
    potPath                 (""),
    inputCS                 (NULL),
    fixedCS                 (NULL),
    targetCS                (NULL),
    eop                     (NULL)
{
    objectTypeNames.push_back("HarmonicField");
    parameterCount = HarmonicFieldParamCount;
    r = s = t = u = 0.0;

    FileManager *fm = FileManager::Instance();
    potPath = fm->GetAbsPathname(bodyName + "_POT_PATH");
#ifdef DEBUG_EOP_FILE
    MessageInterface::ShowMessage
    ("HarmonicField() constructor, this=<%p>, name='%s'\n", this, name.c_str());
#endif
}
コード例 #14
0
void test_delete_record() {
	int fileID;
	FileManager* fm = new FileManager();
	fm->openFile("testfile.txt", fileID); //打开文件,fileID是返回的文件id
	RecordManager* test = new RecordManager(fm);
	test->load_table_info(fileID);
	vector<string> newRecord, newRecord2, newRecord3;

	newRecord.push_back("106001");
	newRecord.push_back("'CHAD CABELLO'");
	newRecord.push_back("'F'");
	newRecord2.push_back("106002");
	newRecord2.push_back("'CHAD CABELLO'");
	newRecord2.push_back("'M'");
	newRecord3.push_back("106003");
	newRecord3.push_back("'CHAD CABELLO'");
	newRecord3.push_back("'F'");
	vector<int> nulls;
	nulls.push_back(1);
	nulls.push_back(1);
	nulls.push_back(1);

	test->insert_record(fileID, newRecord, nulls);	
	test->insert_record(fileID, newRecord2, nulls);
	test->insert_record(fileID, newRecord3, nulls);

	test->print_all_record(fileID);
	test->delete_record(fileID, 2);
	test->insert_record(fileID, newRecord, nulls);	
	test->print_all_record(fileID);
	// for (int i = 0; i < 9000; i++) {
	// 	test->insert_record(fileID, newRecord);
	// }
	// test->print_all_record();
}
コード例 #15
0
ファイル: Main.cpp プロジェクト: francarfox/DataTeam
int main() {
	cout << "!!!DataTeam project start!!!" << endl;

//	int totalTrainRecords = 878049;
	int totalTrainRecords = 100000;
	int totalTestRecords = 884261;
	string predictFieldName = "Category";
	string trainFileName = string("../DataTeam/files/train.csv");
	string testFileName = string("../DataTeam/files/test.csv");
	string trainNewFileName = string("../DataTeam/files/trainNew.csv");
	string submissionFileName = string("../DataTeam/files/submission.csv");

	//	Preparar el archivo para que funcione al pasarlo al NaiveBayes
	FileManager fileManager = FileManager(totalTrainRecords, trainFileName, trainNewFileName);
	fileManager.process();

	//	Pasarle el archivo con los datos de los registros como numericos
//	NaiveBayes naiveBayes = NaiveBayes(predictFieldName, fileManager.getSetterData());
//	naiveBayes.train(totalTrainRecords, trainNewFileName);
//	naiveBayes.test(totalTestRecords, testFileName, submissionFileName);

	KNN knn = KNN(50, fileManager.getSetterData());
	knn.aplicarKNN(trainNewFileName,testFileName,submissionFileName);

	cout << "Finish run app" << endl;
	return 0;
}
コード例 #16
0
//------------------------------------------------------------------------------
HarmonicField::HarmonicField(const std::string &name, const std::string &typeName,
                             Integer maxDeg, Integer maxOrd) :
GravityBase             (typeName, name),
hMinitialized           (false),
maxDegree               (maxDeg),
maxOrder                (maxOrd),
degree                  (4),
order                   (4),
filename                (""),
fileRead                (false),
usingDefaultFile        (false),
isFirstTimeDefault      (true),
inputCSName             ("EarthMJ2000Eq"),
fixedCSName             ("EarthFixed"),
targetCSName            ("EarthMJ2000Eq"),
potPath                 (""),
inputCS                 (NULL),
fixedCS                 (NULL),
targetCS                (NULL),
eop                     (NULL)
{
   objectTypeNames.push_back("HarmonicField");
   parameterCount = HarmonicFieldParamCount;
   r = s = t = u = 0.0;
   
   FileManager *fm = FileManager::Instance();
   potPath = fm->GetAbsPathname(bodyName + "_POT_PATH");
   
}
コード例 #17
0
ファイル: main.cpp プロジェクト: ctSkennerton/fxtract
void tokenizePatternFile(std::ifstream& in) {
    // tokenize a line from the pattern file.  The first part will be the pattern and the second
    // part is the file to write to.

    std::string lineptr;

    while(in.good()) {
        std::getline(in, lineptr);
        if(lineptr.empty()) {
            continue;
        }
        std::vector<std::string> fields;
        split(fields, lineptr, "\t");
        switch(fields.size()) {
            case 0:
                break;
            case 1:
                manager.add(fields[0]);
                if(opts.r_flag) {
                    std::string rcpattern = fields[0];
                    reverseComplement(rcpattern);
                    manager.add(rcpattern);
                }
                break;
            default:
                manager.add(fields[0], fields[1]);
                if(opts.r_flag) {
                    std::string rcpattern = fields[0];
                    reverseComplement(rcpattern);
                    manager.add(rcpattern, fields[1]);
                }
                break;
        }
    }
}
コード例 #18
0
bool CompilerInstance::InitializeSourceManager(const FrontendInputFile &Input,
                                               DiagnosticsEngine &Diags,
                                               FileManager &FileMgr,
                                               SourceManager &SourceMgr,
                                               const FrontendOptions &Opts) {
  SrcMgr::CharacteristicKind
    Kind = Input.isSystem() ? SrcMgr::C_System : SrcMgr::C_User;

  if (Input.isBuffer()) {
    SourceMgr.createMainFileIDForMemBuffer(Input.getBuffer(), Kind);
    assert(!SourceMgr.getMainFileID().isInvalid() &&
           "Couldn't establish MainFileID!");
    return true;
  }

  StringRef InputFile = Input.getFile();

  // Figure out where to get and map in the main file.
  if (InputFile != "-") {
    const FileEntry *File = FileMgr.getFile(InputFile);
    if (!File) {
      Diags.Report(diag::err_fe_error_reading) << InputFile;
      return false;
    }

    // The natural SourceManager infrastructure can't currently handle named
    // pipes, but we would at least like to accept them for the main
    // file. Detect them here, read them with the more generic MemoryBuffer
    // function, and simply override their contents as we do for STDIN.
    if (File->isNamedPipe()) {
      OwningPtr<llvm::MemoryBuffer> MB;
      if (llvm::error_code ec = llvm::MemoryBuffer::getFile(InputFile, MB)) {
        Diags.Report(diag::err_cannot_open_file) << InputFile << ec.message();
        return false;
      }

      // Create a new virtual file that will have the correct size.
      File = FileMgr.getVirtualFile(InputFile, MB->getBufferSize(), 0);
      SourceMgr.overrideFileContents(File, MB.take());
    }

    SourceMgr.createMainFileID(File, Kind);
  } else {
    OwningPtr<llvm::MemoryBuffer> SB;
    if (llvm::MemoryBuffer::getSTDIN(SB)) {
      // FIXME: Give ec.message() in this diag.
      Diags.Report(diag::err_fe_error_reading_stdin);
      return false;
    }
    const FileEntry *File = FileMgr.getVirtualFile(SB->getBufferIdentifier(),
                                                   SB->getBufferSize(), 0);
    SourceMgr.createMainFileID(File, Kind);
    SourceMgr.overrideFileContents(File, SB.take());
  }

  assert(!SourceMgr.getMainFileID().isInvalid() &&
         "Couldn't establish MainFileID!");
  return true;
}
コード例 #19
0
// Initialize the remapping of files to alternative contents, e.g.,
// those specified through other files.
static void InitializeFileRemapping(DiagnosticsEngine &Diags,
                                    SourceManager &SourceMgr,
                                    FileManager &FileMgr,
                                    const PreprocessorOptions &InitOpts) {
  // Remap files in the source manager (with buffers).
  for (PreprocessorOptions::const_remapped_file_buffer_iterator
         Remap = InitOpts.remapped_file_buffer_begin(),
         RemapEnd = InitOpts.remapped_file_buffer_end();
       Remap != RemapEnd;
       ++Remap) {
    // Create the file entry for the file that we're mapping from.
    const FileEntry *FromFile = FileMgr.getVirtualFile(Remap->first,
                                                Remap->second->getBufferSize(),
                                                       0);
    if (!FromFile) {
      Diags.Report(diag::err_fe_remap_missing_from_file)
        << Remap->first;
      if (!InitOpts.RetainRemappedFileBuffers)
        delete Remap->second;
      continue;
    }

    // Override the contents of the "from" file with the contents of
    // the "to" file.
    SourceMgr.overrideFileContents(FromFile, Remap->second,
                                   InitOpts.RetainRemappedFileBuffers);
  }

  // Remap files in the source manager (with other files).
  for (PreprocessorOptions::const_remapped_file_iterator
         Remap = InitOpts.remapped_file_begin(),
         RemapEnd = InitOpts.remapped_file_end();
       Remap != RemapEnd;
       ++Remap) {
    // Find the file that we're mapping to.
    const FileEntry *ToFile = FileMgr.getFile(Remap->second);
    if (!ToFile) {
      Diags.Report(diag::err_fe_remap_missing_to_file)
      << Remap->first << Remap->second;
      continue;
    }
    
    // Create the file entry for the file that we're mapping from.
    const FileEntry *FromFile = FileMgr.getVirtualFile(Remap->first,
                                                       ToFile->getSize(), 0);
    if (!FromFile) {
      Diags.Report(diag::err_fe_remap_missing_from_file)
      << Remap->first;
      continue;
    }
    
    // Override the contents of the "from" file with the contents of
    // the "to" file.
    SourceMgr.overrideFileContents(FromFile, ToFile);
  }

  SourceMgr.setOverridenFilesKeepOriginalName(
                                        InitOpts.RemappedFilesKeepOriginalName);
}
コード例 #20
0
void Texture::LoadFromBuffer(char *buffer, unsigned int bufferLength)
{
    FileManager *fm = FileManager::CreateManager();
    GLubyte *textureData = fm->CreateBitmapData(buffer, bufferLength, &_texWidth, &_texHeight);
    
    _name = SetupTexture(textureData);
    _disposed = false;
}
コード例 #21
0
ファイル: linuxrespath.cpp プロジェクト: Voidious/BerryBots
std::string resourcePath() {
  FileManager fileManager;
  if (fileManager.fileExists("/usr/share/berrybots")) {
    return std::string("/usr/share/berrybots/");
  } else {
    return "./";
  }
}
コード例 #22
0
int main(int argc, char* argv[]) {
	string a = Directory::getCurrentDirectory();
	cout << a;
	FileManager fileManager;
	vector<string> files = fileManager.getFiles(a, "*.h");
	for (int i = 0; i < files.size(); i++)
		cout << endl << files[i];
	return 0;
}
コード例 #23
0
Texture::Texture(string filename)
{
    
    FileManager *fm = FileManager::CreateManager();
    GLubyte *textureData = fm->CreateBitmapData(filename, &_texWidth, &_texHeight);
    
    _name = SetupTexture(textureData);
    _textureFilename = filename;
    _fromFile = true;
}
コード例 #24
0
bool Font::LoadFromFile(const std::string& filePath)
{
	FileManager fr;
	fr.OpenFile(filePath);
	m_fontData = fr.ReadBinary();

	if (!m_fontData.ptr())
		return false;
	m_loaded = true;
	return true;
}
コード例 #25
0
/**
 * Constructor.
 * 
 * Created the master file which stores all the meta data about various distributed file systems.
 */
DistributedFileSystemManager :: DistributedFileSystemManager(const string root_path) {
    this->root_path = root_path;
    
    // Create meta data file.
    const string path = root_path + "/" +  METADATA_FILE;
    
    FileManager fileManager;
    if (!fileManager.findIfExists(path) && !fileManager.createFile (path, "")) {
        cout << "Failed to create DFS manager metadata file." << endl;
        exit(1);
    }
}
コード例 #26
0
ファイル: ap_sound.cpp プロジェクト: armctec/ASCIIpOrtal
int sound_init () {
  //Initialize SDL_mixer
  if( Mix_OpenAudio( 22050, MIX_DEFAULT_FORMAT, 2, 1024 ) == -1 ) return false;

  for (int c = 0; c < MAXSound; c++)
    soundEffects[c] = Mix_LoadWAV( filemgr.get_media(sound_files[c]).c_str() );

  ambience = Mix_LoadMUS( filemgr.get_media(music_files[0]).c_str() );

  if (ambience == NULL) return 0;
  return 1;
}
コード例 #27
0
ファイル: Main.cpp プロジェクト: IgorVi/File-Manager
int main(int argc, char* argv[])
{
	setlocale(LC_ALL, "Russian");
	system("color 1F");

	FileManager fm;

	fm.setPath(argv[0]);
	
	fm.Command();
	
	return 0;
}
コード例 #28
0
////////////////////////////////////////////////////////////////////////////////
//checkFileAccessValidation: pass in the upcoming fileName
//check whether file already there or not
//1)if file already there, skip create new folder,then check its owner name;   
//2)file not there, store it.
//////////////////////////////////////
bool checkFileAccessValidation(std::string msg)
{
	bool retmsg = true;
	FileManager filemgr;
	std::vector<std::string> fileList = filemgr.getFileList("..\\Reciever\\storedPackage");
	for(size_t i=0; i< fileList.size(); i++){
		if(msg == fileList[i]){	 //if found the file in current repository, then return false
			retmsg = false;
			break;
		}
	}
	return retmsg;
}
コード例 #29
0
ファイル: link.cpp プロジェクト: Vangasse/Huffman
void Link::startDeCom(QString origin)
{
    FileManager *huffman = new FileManager();
    Environmentalist *businesMan = new Environmentalist();
    Sourdough *garimpeiro = new Sourdough();

    garimpeiro->receiveFile(origin);
    garimpeiro->deCoder();

    businesMan->plantTree(garimpeiro->getEncodedTree());

    huffman->createDepressedFile(businesMan->getRoot(), garimpeiro->getDeGold(), garimpeiro->getName());
}
コード例 #30
0
//------------------------------------------------------------------------------
// virtual void LoadData()
//------------------------------------------------------------------------------
void RunScriptFolderDialog::LoadData()
{
   #ifdef DEBUG_RUN_SCRIPT_FOLDER_DIALOG
   MessageInterface::ShowMessage("RunScriptFolderDialog::LoadData() entered.\n");
   #endif
   
   wxString str;
   str.Printf("%d", mNumScriptsToRun);
   mNumScriptsToRunTextCtrl->SetValue(str);
   
   FileManager *fm = FileManager::Instance();
   wxString sep = fm->GetPathSeparator().c_str();
   
   try
   {
      mCurrOutDir = fm->GetFullPathname(FileManager::OUTPUT_PATH).c_str();
   }
   catch (BaseException &e)
   {
      MessageInterface::ShowMessage(e.GetFullMessage());
   }
   
   #ifdef DEBUG_RUN_SCRIPT_FOLDER_DIALOG
   MessageInterface::ShowMessage("   mCurrOutDir='%s'\n", mCurrOutDir.c_str());
   #endif
   
   mSaveScriptsDirTextCtrl->SetValue(mCurrOutDir + "AutoSave");
   mCurrOutDirTextCtrl->SetValue(mCurrOutDir);
   
   //=======================================================
   #ifdef __ENABLE_COMPARE__
   //=======================================================
   str.Printf("%g", mAbsTol);
   mAbsTolTextCtrl->SetValue(str);
   mCompareDirTextCtrl->SetValue(mCompareDir);
   mSaveFileTextCtrl->SetValue(mCompareDir + sep + "CompareNumericResults.txt");
   mSaveResultCheckBox->Disable();
   mSaveFileTextCtrl->Disable();
   mSaveBrowseButton->Disable();
   mSaveScriptsDirTextCtrl->Disable();
   mChangeSaveScriptsDirButton->Disable();
   //=======================================================
   #endif
   //=======================================================
   
   theOkButton->Enable();
   
   #ifdef DEBUG_RUN_SCRIPT_FOLDER_DIALOG
   MessageInterface::ShowMessage("RunScriptFolderDialog::LoadData() leaving.\n");
   #endif
}