您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ wxFopen函数代码示例

51自学网 2021-06-03 10:09:37
  C++
这篇教程C++ wxFopen函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中wxFopen函数的典型用法代码示例。如果您正苦于以下问题:C++ wxFopen函数的具体用法?C++ wxFopen怎么用?C++ wxFopen使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了wxFopen函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Compile

// Build up and save an index into the poetry data file, for// rapid random accessbool Compile(void){    FILE *file;    int j;    int ch;    wxChar buf[100];    if (data_filename)        wxSprintf(buf, wxT("%s.dat"), data_filename);    file = wxFopen(buf, wxT("rb"));    if (! (data_filename && file))    {        wxSprintf(error_buf, wxT("Poetry data file %s not found/n"), buf);        PoetryError(error_buf);        return false;    }    nitems = 0;    // Do first one (?)    poem_index[nitems] = 0;    nitems ++;    // Do rest    do {        ch = getc(file);        if (ch == '#')        {            ch = getc(file);            long data;            data = ftell(file);            poem_index[nitems] = data;            nitems ++;        }    } while (ch != EOF);    fclose(file);    if (index_filename)      wxSprintf(buf, wxT("%s.idx"), index_filename);    file = wxFopen(buf, wxT("w"));    if (! (data_filename && file))    {        wxSprintf(error_buf, wxT("Poetry index file %s cannot be created/n"), buf);        PoetryError(error_buf);        return false;    }    wxFprintf(file, wxT("%ld/n/n"), nitems);    for (j = 0; j < nitems; j++)        wxFprintf(file, wxT("%ld/n"), poem_index[j]);    fclose(file);    PoetryNotify(wxT("Poetry index compiled."));    return true;}
开发者ID:cjd,项目名称:wxwidgets31,代码行数:60,


示例2: wxFopen

bool CMPCInfo::ReadMetaData(CSongMetaData & MetaData) const{	StreamInfo info;												FILE *fp = wxFopen( MetaData.Filename.GetFullPath(), wxT("rb") );	if (!fp) 		return false;	Reader_file reader(fp); 	if (info.ReadStreamInfo(&reader) != ERROR_CODE_OK)	{		return false;	}	MetaData.nBitrate = (int)(info.simple.AverageBitrate / 1024.0);	MetaData.nFilesize = info.simple.TotalFileLength;	MetaData.nDuration_ms = info.simple.PCMSamples * 1000 / info.simple.SampleFreq;	CSimpleTagReader tr;	CSimpleTagReader::CFile trf(fp,false);	tr.ReadTags(trf,ConvToUTF8(MetaData.Filename.GetFullPath()));	MetaData.Album =  tr.TagValue(SIMPLETAG_FIELD_ALBUM);	MetaData.Title =  tr.TagValue(SIMPLETAG_FIELD_TITLE);	MetaData.Notes =  tr.TagValue(SIMPLETAG_FIELD_NOTES);	MetaData.Artist =  tr.TagValue(SIMPLETAG_FIELD_ARTIST);	MetaData.Year =  tr.TagValue(SIMPLETAG_FIELD_YEAR);	MetaData.Genre =  tr.TagValue(SIMPLETAG_FIELD_GENRE);	char* track = tr.TagValue(SIMPLETAG_FIELD_TRACK);	MetaData.nTracknum = track ? atoi(track) : 0;	return true;}
开发者ID:BackupTheBerlios,项目名称:musik-svn,代码行数:28,


示例3: _

int WinEDA_ModuleEditFrame::Create_Librairie(const wxString & LibName)/**********************************************************************/{FILE * lib_module;wxString msg;		if ( wxFileExists(LibName) )		{		msg = _("Library exists ") + LibName;		DisplayError(this, msg);		return(0);		}	if ((lib_module = wxFopen(LibName, wxT("wt") ))  == NULL )		{		msg = _("Unable to create ") + LibName;		DisplayError(this, msg);		return(-1);		}	/* Ecriture de l'entete de la nouvelle librairie */	if( fprintf(lib_module,ENTETE_LIBRAIRIE) == 0)		{		msg = _("Create error ") + LibName;		DisplayError(this, msg);		fclose(lib_module) ; return(-1);		}	fprintf(lib_module,"  %s/n", DateAndTime(cbuf));	fputs("$INDEX/n",lib_module);	fputs("$EndINDEX/n",lib_module);	fclose(lib_module) ;	return(1);}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:35,


示例4: while

void rc2wxr::Convert(wxString wxrfile, wxString rcfile){    m_rc.Open(rcfile);    m_filesize=m_rc.Length();    if( (m_wxr  = wxFopen( wxrfile, _T("wt") )) == NULL )    {        return;    }    wxString tok,prevtok;    while (!m_done)    {        tok=GetToken();        if (tok==_T("DIALOG"))        {            ParseDialog(prevtok);        }        if (tok==_T("MENU"))        {            ParseMenu(prevtok);        }        prevtok=tok;    }    fclose(m_wxr);    m_rc.Close();}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:32,


示例5: wxASSERT

bool GERBER_PLOTTER::EndPlot(){    char     line[1024];    wxString msg;    wxASSERT( outputFile );    /* Outfile is actually a temporary file i.e. workFile */    fputs( "M02*/n", outputFile );    fflush( outputFile );    fclose( workFile );    workFile   = wxFopen( m_workFilename, wxT( "rt" ));    wxASSERT( workFile );    outputFile = finalFile;    // Placement of apertures in RS274X    while( fgets( line, 1024, workFile ) )    {        fputs( line, outputFile );        if( strcmp( strtok( line, "/n/r" ), "G04 APERTURE LIST*" ) == 0 )        {            writeApertureList();            fputs( "G04 APERTURE END LIST*/n", outputFile );        }    }    fclose( workFile );    fclose( finalFile );    ::wxRemoveFile( m_workFilename );    outputFile = 0;    return true;}
开发者ID:zhihuitech,项目名称:kicad-source-mirror,代码行数:35,


示例6: fullpath

FILE* fcFileOpener::try_open(const wxString &path, const wxString &name, wxString &filepath){    wxString fullpath ( path + FC_PATH_SEP + name );    wxFileName fn(fullpath);        fullpath = fn.GetFullPath();    FILE *fp = wxFopen(fullpath, "rb");    if ( fp ) {        _scannedfiles.insert( name );        wxString pathPart = fn.GetPath();        for(size_t i=0; i<_excludePaths.size(); ++i) {            if ( pathPart.StartsWith(_excludePaths.at(i) ) ) {                ::fclose( fp );                return NULL;            }        }        _matchedfiles.insert( fullpath );        filepath = fullpath;        return fp;    }    return NULL;}
开发者ID:05storm26,项目名称:codelite,代码行数:25,


示例7: LoadIndex

// Load index fileint LoadIndex(const wxChar *file_name){    long data;    FILE *index_file;    wxChar buf[100];    if (file_name == NULL)        return 0;    wxSprintf(buf, wxT("%s.idx"), file_name);    index_file = wxFopen(buf, wxT("r"));    if (index_file == NULL)        return 0;    wxFscanf(index_file, wxT("%ld"), &nitems);    for (int i = 0; i < nitems; i++)    {        wxFscanf(index_file, wxT("%ld"), &data);        poem_index[i] = data;    }    fclose(index_file);    return 1;}
开发者ID:cjd,项目名称:wxwidgets31,代码行数:29,


示例8: DisplayError

int WinEDA_CvpcbFrame::SaveNetList(void)/****************************************//* Sauvegarde des fichiers netliste et cmp	Le nom complet du fichier Netliste doit etre dans FFileName.	Le nom du fichier cmp en est deduit*/{	if( savecmp() == 0 )		{		DisplayError(this, _("Unable to create component file (.cmp)") );		return(0);		}	dest = wxFopen(FFileName, wxT("wt") );	if( dest == 0 )		{		DisplayError(this, _("Unable to create netlist file") );		return(0);		}	switch ( output_type )		{		default:		case 0:		case 1: genorcad() ;			break;		}	return(1);}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:30,


示例9: wxLogTrace

bool VRML1_MODEL_PARSER::Load( const wxString& aFilename ){    char text[BUFLINE_SIZE];    wxLogTrace( traceVrmlV1Parser, wxT( "Loading: %s" ), GetChars( aFilename ) );    m_file = wxFopen( aFilename, wxT( "rt" ) );    if( m_file == NULL )        return false;    // Switch the locale to standard C (needed to print floating point numbers)    LOCALE_IO toggle;    m_ModelParser->childs.clear();    while( GetNextTag( m_file, text, sizeof(text) ) )    {        if( ( *text == '}' ) || ( *text == ']' ) )        {            continue;        }        if( strcmp( text, "Separator" ) == 0 )        {            m_model.reset( new S3D_MESH() );            m_ModelParser->childs.push_back( m_model );            read_separator();        }    }    fclose( m_file );    return true;}
开发者ID:RocFan,项目名称:kicad-source-mirror,代码行数:35,


示例10: Mask

void WinEDA_ModuleEditFrame::Export_Module(MODULE* ptmod, bool createlib)/************************************************************************//*Genere 1 fichier type Empreinte a partir de la description du module sur PCB*/{wxString FullFileName, Mask( wxT("*") );char Line[1025];FILE * dest;wxString msg, path;	if ( ptmod == NULL ) return;	ptmod->m_LibRef = ptmod->m_Reference->m_Text;	FullFileName = ptmod->m_LibRef;	FullFileName += createlib ? LibExtBuffer : EXT_CMP;	Mask += createlib ? LibExtBuffer : EXT_CMP;	if ( createlib ) path = g_RealLibDirBuffer; 	FullFileName = EDA_FileSelector( createlib ? _("Create lib") : _("Export Module:"),					path,				/* Chemin par defaut */					FullFileName,		/* nom fichier par defaut */					createlib ? LibExtBuffer : EXT_CMP,			/* extension par defaut */					Mask,		/* Masque d'affichage */					this,					wxSAVE,					TRUE					);	if ( FullFileName.IsEmpty() ) return;	if ( createlib  && wxFileExists(FullFileName) )	{		msg.Printf( _("File %s exists, OK to replace ?"),				FullFileName.GetData());		if( ! IsOK(this, msg) ) return;	}	/* Generation du fichier Empreinte */	if ( (dest = wxFopen(FullFileName, wxT("wt")) ) == NULL )	{		msg.Printf( _("Unable to create <%s>"),FullFileName.GetData()) ;		DisplayError(this, msg) ;		return ;	}	fprintf(dest,"%s  %s/n", ENTETE_LIBRAIRIE, DateAndTime(Line));	fputs("$INDEX/n",dest);	fprintf(dest,"%s/n", CONV_TO_UTF8(ptmod->m_LibRef) );	fputs("$EndINDEX/n",dest);	m_Pcb->m_Modules->WriteDescr(dest);	fputs("$EndLIBRARY/n",dest);	fclose(dest) ;	msg.Printf( _("Module exported in file <%s>"),FullFileName.GetData()) ;	DisplayInfo(this, msg) ;}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:60,


示例11: WriteNetList

void WriteNetList(WinEDA_DrawFrame * frame, const wxString & FileNameNL,				bool use_netnames)/*******************************************************************//* Create the netlist file ( Format is given by g_NetFormat )	bool use_netnames is used only for Spice netlist*/{FILE *f = NULL;	if ( g_NetFormat < NET_TYPE_CUSTOM1 )	{		if ((f = wxFopen(FileNameNL, wxT("wt"))) == NULL)		{			wxString msg =  _("Failed to create file ") + FileNameNL;			DisplayError(frame, msg);			return;		}	}wxBusyCursor Busy;	switch ( g_NetFormat )	{		case NET_TYPE_PCBNEW :			WriteNetListPCBNEW(frame, f, TRUE);			fclose(f);			break;		case NET_TYPE_ORCADPCB2 :			WriteNetListPCBNEW(frame, f, FALSE);			fclose(f);			break;		case NET_TYPE_CADSTAR :			WriteNetListCADSTAR(frame, f);			fclose(f);			break;		case NET_TYPE_SPICE :			WriteNetListPspice(frame, f, use_netnames);			fclose(f);			break;		case NET_TYPE_CUSTOM1 :		case NET_TYPE_CUSTOM2 :		case NET_TYPE_CUSTOM3 :		case NET_TYPE_CUSTOM4 :		case NET_TYPE_CUSTOM5 :		case NET_TYPE_CUSTOM6 :		case NET_TYPE_CUSTOM7 :		case NET_TYPE_CUSTOM8 :			Write_GENERIC_NetList(frame, FileNameNL);			break;		default:			DisplayError(frame, wxT("WriteNetList() err: Unknown Netlist Format"));			break;	}}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:59,


示例12: OnButtonBrowseRptFileClick

void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event ){    wxString reportName;    if( m_CreateRptCtrl->IsChecked() )      // Create a file rpt    {        reportName = m_RptFilenameCtrl->GetValue();        if( reportName.IsEmpty() )        {            wxCommandEvent junk;            OnButtonBrowseRptFileClick( junk );        }        reportName = m_RptFilenameCtrl->GetValue();    }    SetDrcParmeters();    m_tester->SetSettings( true,        // Pad to pad DRC test enabled                           true,        // unconnected pdas DRC test enabled                           true,        // DRC test for zones enabled                           true,        // DRC test for keepout areas enabled                           reportName, m_CreateRptCtrl->IsChecked() );    DelDRCMarkers();    wxBeginBusyCursor();    // run all the tests, with no UI at this time.    m_Messages->Clear();    wxSafeYield();                          // Allows time slice to refresh the m_Messages window    m_tester->m_pcb->m_Status_Pcb = 0;      // Force full connectivity and ratsnest recalculations    m_tester->RunTests(m_Messages);    m_Notebook->ChangeSelection( 0 );       // display the 1at tab "...Markers ..."    // Generate the report    if( !reportName.IsEmpty() )    {        FILE* fp = wxFopen( reportName, wxT( "w" ) );        writeReport( fp );        fclose( fp );        wxString        msg;        msg.Printf( _( "Report file /"%s/" created" ), GetChars( reportName ) );        wxString        caption( _( "Disk File Report Completed" ) );        wxMessageDialog popupWindow( this, msg, caption );        popupWindow.ShowModal();    }    wxEndBusyCursor();    RedrawDrawPanel();}
开发者ID:chgans,项目名称:kicad,代码行数:58,


示例13: wxFopen

bool GBR_TO_PCB_EXPORTER::ExportPcb( LAYER_NUM* LayerLookUpTable, int aCopperLayers ){    m_fp = wxFopen( m_pcb_file_name, wxT( "wt" ) );    if( m_fp == NULL )    {        wxString msg;        msg.Printf( _( "Cannot create file <%s>" ), GetChars( m_pcb_file_name ) );        DisplayError( m_gerbview_frame, msg );        return false;    }    m_pcbCopperLayersCount = aCopperLayers;    writePcbHeader();    // create an image of gerber data    // First: non copper layers:    GERBER_DRAW_ITEM* gerb_item = m_gerbview_frame->GetItemsList();    for( ; gerb_item; gerb_item = gerb_item->Next() )    {        LAYER_NUM layer = gerb_item->GetLayer();        LAYER_NUM pcb_layer_number = LayerLookUpTable[layer];        if( !IsPcbLayer( pcb_layer_number ) )            continue;        if( pcb_layer_number > LAST_COPPER_LAYER )            export_non_copper_item( gerb_item, pcb_layer_number );    }    // Copper layers    fprintf( m_fp, "$TRACK/n" );    gerb_item = m_gerbview_frame->GetItemsList();    for( ; gerb_item; gerb_item = gerb_item->Next() )    {        LAYER_NUM layer = gerb_item->GetLayer();        LAYER_NUM pcb_layer_number = LayerLookUpTable[layer];        if( pcb_layer_number < 0 || pcb_layer_number > LAST_COPPER_LAYER )            continue;        else            export_copper_item( gerb_item, pcb_layer_number );    }    fprintf( m_fp, "$EndTRACK/n" );    fprintf( m_fp, "$EndBOARD/n" );    fclose( m_fp );    m_fp = NULL;    return true;}
开发者ID:barrem,项目名称:kicad-source-mirror,代码行数:55,


示例14: wxFopen

void ElfObject::readFile(){	int rsize = 0;	FILE *f = wxFopen( filename, "rb" );	if (f == NULL) throw Exception::FileNotFound( filename );	fseek(f, 0, SEEK_SET);	rsize = fread(data.GetPtr(), 1, data.GetSizeInBytes(), f);	fclose( f );	if (rsize < data.GetSizeInBytes()) throw Exception::EndOfStream(filename);}
开发者ID:IlDucci,项目名称:pcsx2,代码行数:12,


示例15: MakeFileName

int WinEDA_FindFrame::ExploreAllLibraries(const wxString & wildmask, wxString & FindList)/****************************************************************************************/{wxString FullFileName;FILE * file;int nbitems = 0, LineNum = 0;char Line[2048], *name;		FullFileName = MakeFileName(g_RealLibDirBuffer, wxT("*"), g_LibExtBuffer);		FullFileName = wxFindFirstFile(FullFileName);	while ( ! FullFileName.IsEmpty() )	{		file = wxFopen(FullFileName, wxT("rt"));		if (file == NULL) continue; 		while (GetLine(file, Line, &LineNum, sizeof(Line)) )		{			if (strnicmp(Line, "DEF", 3) == 0)			{ /* Read one DEF part from library: DEF 74LS00 U 0 30 Y Y 4 0 N */				strtok(Line, " /t/r/n");				name = strtok(NULL, " /t/r/n");				wxString st_name = CONV_FROM_UTF8(name);				if( WildCompareString(wildmask, st_name, FALSE) )				{					nbitems ++;					if ( ! FindList.IsEmpty() ) FindList += wxT("/n");					FindList << _("Found ") << CONV_FROM_UTF8(name)							<< _(" in lib ") << FullFileName;				}			}			else if (strnicmp(Line, "ALIAS", 5) == 0)			{ /* Read one ALIAS part from library: ALIAS 74HC00 74HCT00 7400 74LS37 */				strtok(Line, " /t/r/n");				while ( (name = strtok(NULL, " /t/r/n")) != NULL )				{					wxString st_name = CONV_FROM_UTF8(name);					if( WildCompareString( wildmask, st_name, FALSE) )					{						nbitems ++;						if ( ! FindList.IsEmpty() ) FindList += wxT("/n");						FindList << _("Found ") << CONV_FROM_UTF8(name)								<< _(" in lib ") << FullFileName;					}				}			}		}		fclose(file);		FullFileName = wxFindNextFile();	}	return nbitems;}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:53,


示例16: ReadDocLib

static void ReadDocLib(const wxString & ModLibName )/***************************************************//* Routine de lecture du fichier Doc associe a la librairie ModLibName.  	Cree en memoire la chaine liste des docs pointee par MList	ModLibName = full file Name de la librairie Modules*/{ModList * NewMod;char Line[1024];FILE * LibDoc;wxString FullModLibName = ModLibName;	ChangeFileNameExt(FullModLibName, EXT_DOC);	if( (LibDoc = wxFopen(FullModLibName, wxT("rt"))) == NULL ) return;	GetLine(LibDoc, Line, NULL, sizeof(Line) -1);	if(strnicmp( Line,ENTETE_LIBDOC, L_ENTETE_LIB) != 0) return;	/* Lecture de la librairie */	while( GetLine(LibDoc,Line, NULL, sizeof(Line) -1) )		{		if( Line[0] != '$' ) continue;		if( Line[1] == 'E' ) break;;		if( Line[1] == 'M' )	/* Debut decription 1 module */			{			NewMod = new ModList();			NewMod->Next = MList;			MList = NewMod;			while( GetLine(LibDoc,Line, NULL, sizeof(Line) -1) )			{				if( Line[0] ==  '$' )	/* $EndMODULE */						break;				switch( Line[0] )				{					case 'L':	/* LibName */						NewMod->m_Name = CONV_FROM_UTF8(StrPurge(Line+3) );						break;					case 'K':	/* KeyWords */						NewMod->m_KeyWord = CONV_FROM_UTF8(StrPurge(Line+3) );						break;					case 'C':	/* Doc */						NewMod->m_Doc = CONV_FROM_UTF8(StrPurge(Line+3) );						break;				}			}		} /* lecture 1 descr module */	}	/* Fin lecture librairie */	fclose(LibDoc);}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:52,


示例17: Close

// Inits the new (or existing) input recording filebool InputRecordingFile::Open(const wxString path, bool fNewOpen, bool fromSaveState){	Close();	wxString mode = L"rb+";	if (fNewOpen)	{		mode = L"wb+";		MaxFrame = 0;		UndoCount = 0;		header.Init();	}	recordingFile = wxFopen(path, mode);	if ( recordingFile == NULL )	{		recordingConLog(wxString::Format("[REC]: Movie file opening failed. Error - %s/n", strerror(errno)));		return false;	}	filename = path;	if (fNewOpen)	{		if (fromSaveState)		{			savestate.fromSavestate = true;			FILE* ssFileCheck = wxFopen(path + "_SaveState.p2s", "r");			if (ssFileCheck != NULL)			{				wxCopyFile(path + "_SaveState.p2s", path + "_SaveState.p2s.bak", false);				fclose(ssFileCheck);			}			StateCopy_SaveToFile(path + "_SaveState.p2s");		}		else		{			sApp.SysExecute();		}	}	return true;}
开发者ID:PCSX2,项目名称:pcsx2,代码行数:40,


示例18: LoadLibraryName

/****************************************************************************** Routine to load the given library name. FullLibName should hold full path  ** of file name to open, while LibName should hold only its name.			 ** IF library already exists, it is NOT reloaded.							 ** return: new lib or NULL													 ******************************************************************************/LibraryStruct * LoadLibraryName(WinEDA_DrawFrame * frame,				const wxString & FullLibName, const wxString & LibName){int NumOfParts;FILE *f;LibraryStruct *NewLib;PriorQue *Entries;wxString FullFileName;	if ( (NewLib = FindLibrary(LibName)) != NULL)	{		if ( NewLib->m_FullFileName == FullLibName )			return NewLib;		FreeCmpLibrary(frame, LibName);	}	NewLib = NULL;	f = wxFopen(FullLibName, wxT("rt") );	if (f == NULL)	{		wxString msg;		msg.Printf( _("Library <%s> not found"), FullLibName.GetData());		DisplayError(frame, msg);		return NULL;	}			NewLib = new LibraryStruct(LIBRARY_TYPE_EESCHEMA, LibName, FullLibName);	Entries = LoadLibraryAux(frame, NewLib, f, &NumOfParts);	if ( Entries != NULL)	{		NewLib->m_Entries = Entries;		NewLib->m_NumOfParts = NumOfParts;				if ( g_LibraryList == NULL ) g_LibraryList = NewLib;		else		{			LibraryStruct *tmplib = g_LibraryList;			while ( tmplib->m_Pnext ) tmplib = tmplib->m_Pnext;			tmplib->m_Pnext = NewLib;		}		FullFileName = FullLibName;		ChangeFileNameExt(FullFileName, DOC_EXT);		LoadDocLib(frame, FullFileName, NewLib->m_Name);	}	else delete NewLib;			fclose(f);	return NewLib;}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:57,


示例19: WriteDiagnosticERC

static bool WriteDiagnosticERC(const wxString & FullFileName)/*********************************************************//* Genere le fichier des diagnostics*/{    SCH_SCREEN * Window;    EDA_BaseStruct * DrawStruct;    DrawMarkerStruct * Marker;    char Line[256];    static FILE * OutErc;    DrawSheetStruct * Sheet;    wxString msg;    if( (OutErc = wxFopen( FullFileName, wxT("wt"))) == NULL ) return FALSE;    DateAndTime(Line);    msg = _("ERC control");    fprintf( OutErc, "%s (%s)/n", CONV_TO_UTF8(msg), Line);    for( Window = ScreenSch; Window != NULL; Window = (SCH_SCREEN*)Window->Pnext )    {        Sheet = (DrawSheetStruct *) Window->m_Parent;        msg.Printf( _("/n***** Sheet %d (%s)/n"),                    Window->m_SheetNumber,                    Sheet ? Sheet->m_Field[VALUE].m_Text.GetData() : _("Root"));        fprintf( OutErc, "%s", CONV_TO_UTF8(msg));        DrawStruct = Window->EEDrawList;        for ( ; DrawStruct != NULL; DrawStruct = DrawStruct->Pnext)        {            if(DrawStruct->m_StructType != DRAW_MARKER_STRUCT_TYPE )                continue;            /* Marqueur trouve */            Marker = (DrawMarkerStruct * ) DrawStruct;            if( Marker->m_Type != MARQ_ERC ) continue;            /* Write diag marqueur */            msg.Printf( _("ERC: %s (X= %2.3f inches, Y= %2.3f inches/n"),                        Marker->GetComment().GetData(),                        (float)Marker->m_Pos.x / 1000,                        (float)Marker->m_Pos.y / 1000);            fprintf( OutErc, "%s", CONV_TO_UTF8(msg));        }    }    msg.Printf( _("/n >> Errors ERC: %d/n"), g_EESchemaVar.NbErrorErc);    fprintf( OutErc, "%s", CONV_TO_UTF8(msg));    fclose ( OutErc );    return TRUE;}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:51,


示例20: ReadData

int Struct3D_Master:: ReadData(void)/************************************/{char line[1024], *text;wxString fullfilename;FILE * file;int LineNum = 0;	if ( m_Shape3DName.IsEmpty() )	{		return 1;	}	fullfilename =  g_RealLibDirBuffer + LIB3D_PATH;	fullfilename += m_Shape3DName;#if defined (__WINDOWS__)	fullfilename.Replace(UNIX_STRING_DIR_SEP,WIN_STRING_DIR_SEP);#else#if defined (__UNIX__)	fullfilename.Replace(WIN_STRING_DIR_SEP,UNIX_STRING_DIR_SEP);#endif#endif	file = wxFopen( fullfilename, wxT("rt") );	if ( file == NULL )	{		return -1;	}	while ( GetLine(file, line, &LineNum, 512) )	{		text = strtok(line, " /t/n/r");		if ( stricmp (text, "DEF" ) == 0 )		{			while ( GetLine(file, line, &LineNum, 512) )			{				text = strtok(line, " /t/n/r");				if ( text == NULL ) continue;				if ( * text == '}' ) break;				if ( stricmp (text, "children") == 0 )				{					ReadChildren(file, &LineNum);				}			}		}	}	fclose (file);	return 0;}
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:50,


示例21: wxASSERT

/* * Open or create the plot file aFullFilename * return true if success, false if the file cannot be created/opened * * Opens the PDF file in binary mode */bool PDF_PLOTTER::OpenFile( const wxString& aFullFilename ){    filename = aFullFilename;    wxASSERT( !outputFile );    // Open the PDF file in binary mode    outputFile = wxFopen( filename, wxT( "wb" ) );    if( outputFile == NULL )        return false ;    return true;}
开发者ID:natsfr,项目名称:kicad,代码行数:20,


示例22: SHGToMap

bool SHGToMap(wxChar *filename, wxChar *defaultFile){  // Test the SHG parser  HotSpot *hotspots = NULL;  int n = ParseSHG(filename, &hotspots);  if (n == 0)    return false;  wxChar buf[100];  wxSnprintf(buf, sizeof(buf), _T("Converting .SHG file to HTML map file: there are %d hotspots in %s."), n, filename);  OnInform(buf);  wxChar outBuf[256];  wxStrcpy(outBuf, filename);  StripExtension(outBuf);  wxStrcat(outBuf, _T(".map"));  FILE *fd = wxFopen(outBuf, _T("w"));  if (!fd)  {    OnError(_T("Could not open .map file for writing."));    delete[] hotspots;    return false;  }  wxFprintf(fd, _T("default %s/n"), defaultFile);  for (int i = 0; i < n; i++)  {    wxChar *refFilename = _T("??");        TexRef *texRef = FindReference(hotspots[i].szHlpTopic_Macro);    if (texRef)      refFilename = texRef->refFile;    else    {      wxChar buf[300];      wxSnprintf(buf, sizeof(buf), _T("Warning: could not find hotspot reference %s"), hotspots[i].szHlpTopic_Macro);      OnInform(buf);    }    wxFprintf(fd, _T("rect %s %d %d %d %d/n"), refFilename, (int)hotspots[i].left, (int)hotspots[i].top,      (int)hotspots[i].right, (int)hotspots[i].bottom);  }  wxFprintf(fd, _T("/n"));  fclose(fd);  delete[] hotspots;  return true;}
开发者ID:nealey,项目名称:vera,代码行数:49,


示例23: throw

FILE_OUTPUTFORMATTER::FILE_OUTPUTFORMATTER( const wxString& aFileName,        const wxChar* aMode,  char aQuoteChar ) throw( IO_ERROR ) :    OUTPUTFORMATTER( OUTPUTFMTBUFZ, aQuoteChar ),    m_filename( aFileName ){    m_fp = wxFopen( aFileName, aMode );    if( !m_fp )    {        wxString msg = wxString::Format(                            _( "cannot open or save file '%s'" ),                            m_filename.GetData() );        THROW_IO_ERROR( msg );    }}
开发者ID:Th0rN13,项目名称:kicad-source-mirror,代码行数:15,


示例24: wxASSERT

bool PLOTTER::OpenFile( const wxString& aFullFilename ){    filename = aFullFilename;    wxASSERT( !outputFile );    // Open the file in text mode (not suitable for all plotters    // but only for most of them    outputFile = wxFopen( filename, wxT( "wt" ) );    if( outputFile == NULL )        return false ;    return true;}
开发者ID:CastMi,项目名称:kicad-source-mirror,代码行数:15,


示例25: WriteDiagnosticERC

bool WriteDiagnosticERC( const wxString& aFullFileName ){    SCH_ITEM*       item;    SCH_MARKER*     marker;    static FILE*    file;    SCH_SHEET_PATH* sheet;    wxString        msg;    int             count = 0;    if( ( file = wxFopen( aFullFileName, wxT( "wt" ) ) ) == NULL )        return false;    msg = _( "ERC report" );    fprintf( file, "%s (%s)/n", TO_UTF8( msg ), TO_UTF8( DateAndTime() ) );    SCH_SHEET_LIST sheetList;    for( sheet = sheetList.GetFirst(); sheet != NULL; sheet = sheetList.GetNext() )    {        msg.Printf( _( "/n***** Sheet %s/n" ), GetChars( sheet->PathHumanReadable() ) );        fprintf( file, "%s", TO_UTF8( msg ) );        for( item = sheet->LastDrawList(); item != NULL; item = item->Next() )        {            if( item->Type() != SCH_MARKER_T )                continue;            marker = (SCH_MARKER*) item;            if( marker->GetMarkerType() != MARK_ERC )                continue;            if( marker->GetMarkerType() == ERR )                count++;            msg = marker->GetReporter().ShowReport();            fprintf( file, "%s", TO_UTF8( msg ) );        }    }    msg.Printf( _( "/n >> Errors ERC: %d/n" ), count );    fprintf( file, "%s", TO_UTF8( msg ) );    fclose( file );    return true;}
开发者ID:natsfr,项目名称:kicad,代码行数:48,



注:本文中的wxFopen函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ wxGBPosition函数代码示例
C++ wxFocusEventHandler函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。