• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Open函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: m_File

cFile::cFile(const AString & iFileName, eMode iMode) :
	m_File(nullptr)
{
	Open(iFileName, iMode);
}
开发者ID:rhamilton1415,项目名称:cuberite,代码行数:5,代码来源:File.cpp


示例2: RecSlaveEntry

void RecSlaveEntry(void)
{
  struct AHIAudioCtrlDrv* AudioCtrl;
  struct DriverBase*      AHIsubBase;
  struct FilesaveBase*    FilesaveBase;

  ULONG   signals;
  BPTR    lock = NULL,cd=0,file = NULL;
  Object *o = NULL;
  BYTE   *samples = NULL;
  ULONG   length = NULL;
  ULONG   count = 0,offs = 0,i;

  struct AHIRecordMessage RecordMessage = 
  {
    AHIST_S16S,
    NULL,
    RECBUFFERSIZE
  };

  AudioCtrl    = (struct AHIAudioCtrlDrv*) FindTask( NULL )->tc_UserData;
  AHIsubBase   = (struct DriverBase*) dd->fs_AHIsubBase;
  FilesaveBase = (struct FilesaveBase*) AHIsubBase;

  RecordMessage.ahirm_Buffer = dd->fs_RecBuffer;

  if(!(lock = Lock(dd->fs_RecFileReq->fr_Drawer,ACCESS_READ)))
    goto quit;
  cd = CurrentDir(lock);

  if(DataTypesBase)
  {
    struct TagItem newtags[] =
    {
      { DTA_GroupID, GID_SOUND },
      { TAG_DONE,    0         }
    };
    
    struct TagItem attrtags[] =
    {
      { SDTA_Sample,       (ULONG) &samples },
      { SDTA_SampleLength, (ULONG) &length  },
      { TAG_DONE,          0                }
    };
    
    if (!(o = NewDTObjectA (dd->fs_RecFileReq->fr_File, newtags)))
      goto quit;

    GetDTAttrsA(o, attrtags );
  }
  else // datatypes.library not open. Open the selected file as raw 8 bit signed instead.
  {
    if(!(file = Open(dd->fs_RecFileReq->fr_File,MODE_OLDFILE)))
      goto quit;
    Seek(file,0,OFFSET_END);
    length = Seek(file,0,OFFSET_BEGINNING);
    if(!(samples = AllocVec(length,MEMF_ANY)))
      goto quit;
    if(length != (ULONG) Read(file,samples,length))
      goto quit;
  }

  if(!samples || !length )
    goto quit;

  if((dd->fs_RecSlaveSignal = AllocSignal(-1)) == -1)
    goto quit;

// Everything set up. Tell Master we're alive and healthy.
    Signal((struct Task *)dd->fs_MasterTask,1L<<dd->fs_RecMasterSignal);

    for(;;)
    {
      signals = SetSignal(0L,0L);
      if(signals & (SIGBREAKF_CTRL_C | 1L<<dd->fs_RecSlaveSignal))
        break;

      for(;;)
      {
        if(count+RECBUFFERSIZE-offs < length)
        {
// End of sample will not be reached; just fill to the end of dd->fs_RecBuffer.
          for(i = RECBUFFERSIZE-offs;i>0;i--)
          {
            dd->fs_RecBuffer[(offs)<<1] = 
            dd->fs_RecBuffer[((offs++)<<1)+1] = 
            samples[count++]<<8;
          }
          offs = 0;
          break;
        }
        else
        {
// End of sample will be reached. Fill part of buffer, and iterate (== don't break).
          for(i = length-count;i>0;i--)
          {
            dd->fs_RecBuffer[(offs)<<1] = 
            dd->fs_RecBuffer[((offs++)<<1)+1] = 
            samples[count++]<<8;
          }
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:101,代码来源:filesave-recslave.c


示例3: Visible

void DtPrinterIcon::NotifyVisiblity(BaseUI *obj)
{
   if (app_mode == CONFIG_PRINTERS)
      return;

   if (obj == flag)
    {
      boolean show_it = Visible();
      if (show_it)
       {
         if (mainw->setPrefD->ShowStatusFlags() == false)
            show_it = false;
         else
	  {
#ifdef aix
            if (_print_queue_up)
             {
	       show_it = false;
               int i;
               for (i = 0; i < n_devices; i++)
                  if (_print_device_up[i] == false)
	           {
	             show_it = true;
	             break;
	           }
             }
	    else
	       show_it = true;
#else
            if (_print_queue_up && _print_device_up)
               show_it = false;
            else
               show_it = true;
#endif
	  }
       }
      if (flag->Visible() != show_it)
         flag->Visible(show_it);
    }
   else if (obj == details_label)
    {
      boolean show_it = Visible();
      if (show_it)
       {
         if (container && IconView() == DETAILS && Open())
	  {
            if (container->NumChildren() == 0 ||
                (container->Children()[0])->UIClass() == LABEL)
               show_it = false;
            else if (mainw->setPrefD->ShowDetailsLabel())
	     {
	       show_it = false;
	       int i;
	       BaseUI **children = container->Children();
	       for (i = 0; i < container->NumChildren(); i++)
	          if (children[i]->Visible())
	           {
	             show_it = true;
	             break;
	           }
	     }
	    else
               show_it = mainw->setPrefD->ShowDetailsLabel();
	  }
         else
            show_it = false;
       }
      if (details_label->Visible() != show_it)
         details_label->Visible(show_it);
    }
}
开发者ID:juddy,项目名称:edcde,代码行数:71,代码来源:DtPrinterIcon.C


示例4: ReadConfig

BOOL
ReadConfig ( struct AHIDevUnit *iounit,
             struct AHIBase *AHIBase )
{
  struct IFFHandle *iff;
  struct StoredProperty *prhd,*ahig;
  struct CollectionItem *ci;

  if(iounit)
  {
    /* Internal defaults for device unit */
    iounit->AudioMode       = AHI_INVALID_ID;   // See at the end of the function!
    iounit->Frequency       = 10000;
    iounit->Channels        = 4;
    iounit->MonitorVolume   = ~0;
    iounit->InputGain       = ~0;
    iounit->OutputVolume    = ~0;
    iounit->Input           = ~0;
    iounit->Output          = ~0;
  }
  else
  {
    /* Internal defaults for low-level mode */
    AHIBase->ahib_AudioMode       = AHI_INVALID_ID;
    AHIBase->ahib_Frequency       = 10000;
    AHIBase->ahib_MonitorVolume   = 0x00000;
    AHIBase->ahib_InputGain       = 0x10000;
    AHIBase->ahib_OutputVolume    = 0x10000;
    AHIBase->ahib_Input           = 0;
    AHIBase->ahib_Output          = 0;
  }

  if((iff=AllocIFF()))
  {
    iff->iff_Stream=Open("ENV:Sys/ahi.prefs", MODE_OLDFILE);
    if(iff->iff_Stream)
    {
      InitIFFasDOS(iff);
      if(!OpenIFF(iff,IFFF_READ))
      {
        if(!(PropChunk(iff,ID_PREF,ID_PRHD)
          || PropChunk(iff,ID_PREF,ID_AHIG)
          || CollectionChunk(iff,ID_PREF,ID_AHIU)
          || StopOnExit(iff,ID_PREF,ID_FORM)))
        {
          if(ParseIFF(iff,IFFPARSE_SCAN) == IFFERR_EOC)
          {
            prhd=FindProp(iff,ID_PREF,ID_PRHD);
            ahig=FindProp(iff,ID_PREF,ID_AHIG);
            
            if(ahig)
            {
              struct AHIGlobalPrefs *globalprefs;
              
              globalprefs = (struct AHIGlobalPrefs *)ahig->sp_Data;

              AHIBase->ahib_DebugLevel = globalprefs->ahigp_DebugLevel;

              AHIBase->ahib_Flags = 0;

              if(globalprefs->ahigp_DisableSurround)
                AHIBase->ahib_Flags |= AHIBF_NOSURROUND;

              if(globalprefs->ahigp_DisableEcho)
                AHIBase->ahib_Flags |= AHIBF_NOECHO;

              if(globalprefs->ahigp_FastEcho)
                AHIBase->ahib_Flags |= AHIBF_FASTECHO;
                
              if( (ULONG) ahig->sp_Size > offsetof( struct AHIGlobalPrefs,
                                                    ahigp_MaxCPU) )
              {
                AHIBase->ahib_MaxCPU = globalprefs->ahigp_MaxCPU;
              }
              else
              {
                AHIBase->ahib_MaxCPU = 0x10000 * 90 / 100;
              }

              if( (ULONG) ahig->sp_Size > offsetof( struct AHIGlobalPrefs, 
                                                    ahigp_ClipMasterVolume) )
              {
                if(globalprefs->ahigp_ClipMasterVolume)
                  AHIBase->ahib_Flags |= AHIBF_CLIPPING;
              }

              if( (ULONG) ahig->sp_Size > offsetof( struct AHIGlobalPrefs, 
                                                    ahigp_AntiClickTime ) )
              {
                AHIBase->ahib_AntiClickTime = globalprefs->ahigp_AntiClickTime;
              }
              else
              {
                AHIBase->ahib_AntiClickTime = 0;
              }

            }
            ci=FindCollection(iff,ID_PREF,ID_AHIU);
            while(ci)
            {
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:101,代码来源:device.c


示例5: infile

void DataStore::ImportDataFromFile(std::string const &file)
{
    std::ifstream infile(file);
    std::string line;
    std::getline(infile, line); //skip first line (assume it's always a header)

    std::vector<std::pair<Record, bool>> vRecordsToAdd; //boolean keeps track if Record already exists in datastore

    //Add all Records from input file to temporary storage
    while (std::getline(infile, line)) {
        std::vector<std::string> const tokens(Utility::Tokenize(line, "|"));

        if (tokens.size() != 6)
            throw std::runtime_error("Bad record in file (found " + std::to_string(tokens.size()) + " fields, expected 6)");

        Record const rec(tokens);
        vRecordsToAdd.emplace_back(std::make_pair(rec, false));
    }

    std::cout << vRecordsToAdd.size() << " record(s) read from file" << std::endl;

    //Read data store (from file) and update existing records
    size_t numUpdated(0);
    Open();
    size_t const size(GetNumRecords());
    for (size_t ii = 0; ii < size; ++ii) {
        Record const oldRec(FetchRecord(ii));

        for (auto &pp : vRecordsToAdd) {
            Record const &rec  (pp.first);
            bool         &added(pp.second);

            if (added)
                continue;

            if (rec == oldRec) {
                UpdateRecord(rec, ii);
                added = true;
                ++numUpdated;
            }
        }
    }

    if (numUpdated > 0)
        std::cout << numUpdated << " record(s) updated in datastore" << std::endl;

    //Finally, add brand new records to datastore
    size_t numAdded(0);
    for (auto const &pp : vRecordsToAdd) {
        Record const &rec(pp.first);
        bool   const &added(pp.second);

        if (!added) {
            AddRecord(rec);
            ++numAdded;
        }
    }

    if (numAdded > 0)
        std::cout << numAdded << " record(s) added to datastore" << std::endl;

    Close();
}
开发者ID:ssbotelh,项目名称:rentrak,代码行数:63,代码来源:DataStore.cpp


示例6: Open

bool COutFile::Open(LPCWSTR fileName, DWORD creationDisposition)
{
    return Open(fileName, FILE_SHARE_READ,  creationDisposition, FILE_ATTRIBUTE_NORMAL);
}
开发者ID:naterh,项目名称:firmware-mod-kit-osx,代码行数:4,代码来源:FileIO.cpp


示例7: af_GetFullPath

bool AFileUnicode::Open(const char* szFolderName, const char * szFileName, ADWORD dwFlags)
{
	char szFullPath[AMAX_PATH];
	af_GetFullPath(szFullPath, szFolderName, szFileName);
	return Open(szFullPath, dwFlags);
}
开发者ID:fengqk,项目名称:Art,代码行数:6,代码来源:AFileUnicode.cpp


示例8: ReadRasterColumn

CPLErr NTFFileReader::ReadRasterColumn( int iColumn, float *pafElev )

{
/* -------------------------------------------------------------------- */
/*      If we don't already have the scanline offset of the previous    */
/*      line, force reading of previous records to establish it.        */
/* -------------------------------------------------------------------- */
    if( panColumnOffset[iColumn] == 0 )
    {
        int     iPrev;
        
        for( iPrev = 0; iPrev < iColumn-1; iPrev++ )
        {
            if( panColumnOffset[iPrev+1] == 0 )
            {
                CPLErr  eErr;
                
                eErr = ReadRasterColumn( iPrev, NULL );
                if( eErr != CE_None )
                    return eErr;
            }
        }
    }

/* -------------------------------------------------------------------- */
/*      If the dataset isn't open, open it now.                         */
/* -------------------------------------------------------------------- */
    if( GetFP() == NULL )
        Open();
    
/* -------------------------------------------------------------------- */
/*      Read requested record.                                          */
/* -------------------------------------------------------------------- */
    NTFRecord   *poRecord;
    
    SetFPPos( panColumnOffset[iColumn], iColumn );
    poRecord = ReadRecord();

    if( iColumn < nRasterXSize-1 )
    {
        GetFPPos( panColumnOffset+iColumn+1, NULL );
    }
    
/* -------------------------------------------------------------------- */
/*      Handle LANDRANGER DTM columns.                                  */
/* -------------------------------------------------------------------- */
    if( pafElev != NULL && GetProductId() == NPC_LANDRANGER_DTM )
    {
        double  dfVScale, dfVOffset;

        dfVOffset = atoi(poRecord->GetField(56,65));
        dfVScale = atoi(poRecord->GetField(66,75)) * 0.001;

        for( int iPixel = 0; iPixel < nRasterXSize; iPixel++ )
        {
            pafElev[iPixel] = (float) (dfVOffset + dfVScale *
                atoi(poRecord->GetField(84+iPixel*4,87+iPixel*4)));
        }
    }
            
/* -------------------------------------------------------------------- */
/*      Handle PROFILE                                                  */
/* -------------------------------------------------------------------- */
    else if( pafElev != NULL && GetProductId() == NPC_LANDFORM_PROFILE_DTM )
    {
        for( int iPixel = 0; iPixel < nRasterXSize; iPixel++ )
        {
            pafElev[iPixel] = (float) 
           (atoi(poRecord->GetField(19+iPixel*5,23+iPixel*5)) * GetZMult());
        }
    }
    
    delete poRecord;

    return CE_None;
}
开发者ID:afarnham,项目名称:gdal,代码行数:76,代码来源:ntf_raster.cpp


示例9: procan

int procan(FILE *outfile) {

   /*filan(0, outfile);*/

   /* controlling terminal */
   fprintf(outfile, "process id = "F_pid"\n", Getpid());
   fprintf(outfile, "process parent id = "F_pid"\n", Getppid());
   {
      int fd;
      if ((fd = Open("/dev/tty", O_NOCTTY, 0)) < 0) {
	 fprintf(outfile, "controlling terminal: -\n");
      } else {
#if 1
	 fprintf(outfile, "controlling terminal: \"%s\"\n", Ttyname(fd));
#else
	 char procpath[PATH_MAX], devpath[PATH_MAX+1];
	 int devlen;
	 sprintf(procpath, "/proc/"F_pid"/fd/%d", Getpid(), 0 /*! fd*/);
	 if ((devlen = Readlink(procpath, devpath, sizeof(devpath))) < 0) {
	    ;
	 } else {
	    devpath[devlen] = '\0';
	    fprintf(outfile, "controlling terminal: \"%s\"\n", devpath);
	 }
#endif
      }
   }
   fprintf(outfile, "process group id = "F_pid"\n", Getpgrp());
#if HAVE_GETSID
   fprintf(outfile, "process session id = "F_pid"\n", Getsid(0));
#endif
   fprintf(outfile, "process group id if fg process / stdin = "F_pid"\n", Tcgetpgrp(0));
   fprintf(outfile, "process group id if fg process / stdout = "F_pid"\n", Tcgetpgrp(1));
   fprintf(outfile, "process group id if fg process / stderr = "F_pid"\n", Tcgetpgrp(2));
   {
      int fd;
      if ((fd = Open("/dev/tty", O_RDWR, 0600)) >= 0) {
	 fprintf(outfile, "process has a controlling terminal\n");
	 Close(fd);
      } else {
	 fprintf(outfile, "process does not have a controlling terminal\n");
      }
   }

   /* process owner, groups */
   fprintf(outfile, "user id  = "F_uid"\n", Getuid());
   fprintf(outfile, "effective user id  = "F_uid"\n", Geteuid());
   fprintf(outfile, "group id = "F_gid"\n", Getgid());
   fprintf(outfile, "effective group id = "F_gid"\n", Getegid());

   {
      struct rlimit rlim;

      fprintf(outfile, "\nRESOURCE LIMITS\n");
      fprintf(outfile, "resource                         current         maximum\n");
      if (getrlimit(RLIMIT_CPU, &rlim) < 0) {
	 Warn2("getrlimit(RLIMIT_CPU, %p): %s", &rlim, strerror(errno));
      } else {
	 fprintf(outfile,
		 "cpu time (seconds)      %16"F_rlim_max"%16"F_rlim_max"\n",
		 rlim.rlim_cur, rlim.rlim_max);
      }
      if (getrlimit(RLIMIT_FSIZE, &rlim) < 0) {
	 Warn2("getrlimit(RLIMIT_FSIZE, %p): %s", &rlim, strerror(errno));
      } else {
	 fprintf(outfile,
		 "file size (blocks)      %16"F_rlim_max"%16"F_rlim_max"\n",
		 rlim.rlim_cur, rlim.rlim_max);
      }
      if (getrlimit(RLIMIT_DATA, &rlim) < 0) {
	 Warn2("getrlimit(RLIMIT_DATA, %p): %s", &rlim, strerror(errno));
      } else {
	 fprintf(outfile,
		 "data seg size (kbytes)  %16"F_rlim_max"%16"F_rlim_max"\n",
		 rlim.rlim_cur, rlim.rlim_max);
      }
      if (getrlimit(RLIMIT_STACK, &rlim) < 0) {
	 Warn2("getrlimit(RLIMIT_STACK, %p): %s", &rlim, strerror(errno));
      } else {
	 fprintf(outfile,
		 "stack size (blocks)     %16"F_rlim_max"%16"F_rlim_max"\n",
		 rlim.rlim_cur, rlim.rlim_max);
      }
      if (getrlimit(RLIMIT_CORE, &rlim) < 0) {
	 Warn2("getrlimit(RLIMIT_CORE, %p): %s", &rlim, strerror(errno));
      } else {
	 fprintf(outfile,
		 "core file size (blocks) %16"F_rlim_max"%16"F_rlim_max"\n",
		 rlim.rlim_cur, rlim.rlim_max);
      }
#ifdef RLIMIT_RSS	/* Linux, AIX; not Cygwin */
      if (getrlimit(RLIMIT_RSS, &rlim) < 0) {
	 Warn2("getrlimit(RLIMIT_RSS, %p): %s", &rlim, strerror(errno));
      } else {
	 fprintf(outfile,
		 "max resident set size   %16"F_rlim_max"%16"F_rlim_max"\n",
		 rlim.rlim_cur, rlim.rlim_max);
      }
#endif
#ifdef RLIMIT_NPROC	/* Linux, not AIX, Cygwin */
//.........这里部分代码省略.........
开发者ID:KiteGh0st,项目名称:opparis,代码行数:101,代码来源:procan.c


示例10: m_file

IOFile::IOFile(const std::string& filename, const char openmode[])
	: m_file(NULL), m_good(true)
{
	Open(filename, openmode);
}
开发者ID:BrainDamage,项目名称:libretro-ppsspp,代码行数:5,代码来源:FileUtil.cpp


示例11: vfsStream

vfsStreamMemory::vfsStreamMemory(u64 addr) : vfsStream()
{
	Open(addr);
}
开发者ID:Yashdhiman,项目名称:rpcs3,代码行数:4,代码来源:vfsStreamMemory.cpp


示例12: Open

/*
--------------------------------------------------------------------------------
open ...
(Standard instances management. Driver specific implementations should be put in Open() function.)
--------------------------------------------------------------------------------
*/
ST_ErrorCode_t STEXTVIN_Open(const ST_DeviceName_t DeviceName, const STEXTVIN_OpenParams_t * const OpenParams_p, STEXTVIN_Handle_t *Handle_p)
{
    S32 DeviceIndex = INVALID_DEVICE_INDEX, UnitIndex, Index;
    U32 OpenedUnitForThisInit;
    ST_ErrorCode_t ErrorCode = ST_NO_ERROR;

    /* Exit now if parameters are bad */
    if ((OpenParams_p == NULL) ||                       /* There must be parameters ! */
        (Handle_p == NULL) ||                           /* Pointer to handle should be valid ! */
        (strlen(DeviceName) > (ST_MAX_DEVICE_NAME - 1)) || /* Device name length should be respected */
        ((((const char *) DeviceName)[0]) == '\0')
       )
    {
        return(ST_ERROR_BAD_PARAMETER);
    }

    EnterCriticalSection();

    if (!FirstInitDone)
    {
        ErrorCode = ST_ERROR_UNKNOWN_DEVICE;
    }
    else
    {
        /* Check if device already initialised and return error if not so */
        DeviceIndex = GetIndexOfDeviceNamed(DeviceName);
        if (DeviceIndex == INVALID_DEVICE_INDEX)
        {
            /* Device name not found */
            ErrorCode = ST_ERROR_UNKNOWN_DEVICE;
        }
        else
        {
            /* Look for a free unit and check all opened units to check if MaxOpen is not reached */
            UnitIndex = STEXTVIN_MAX_UNIT;
            OpenedUnitForThisInit = 0;
            for (Index = 0; Index < STEXTVIN_MAX_UNIT; Index++)
            {
                if ((STEXTVIN_UnitArray[Index].UnitValidity == STEXTVIN_VALID_UNIT) && (STEXTVIN_UnitArray[Index].Device_p == &DeviceArray[DeviceIndex]))
                {
                    OpenedUnitForThisInit ++;
                }
                if (STEXTVIN_UnitArray[Index].UnitValidity != STEXTVIN_VALID_UNIT)
                {
                    /* Found a free handle structure */
                    UnitIndex = Index;
                }
            }
            if ((OpenedUnitForThisInit >= DeviceArray[DeviceIndex].MaxOpen) || (UnitIndex >= STEXTVIN_MAX_UNIT))
            {
                /* None of the units is free or MaxOpen reached */
                ErrorCode = ST_ERROR_NO_FREE_HANDLES;
            }
            else
            {
                *Handle_p = (STEXTVIN_Handle_t) &STEXTVIN_UnitArray[UnitIndex];
                STEXTVIN_UnitArray[UnitIndex].Device_p = &DeviceArray[DeviceIndex];

                /* API specific actions after opening */
                ErrorCode = Open(&STEXTVIN_UnitArray[UnitIndex], OpenParams_p);

                if (ErrorCode == ST_NO_ERROR)
                {
                    /* Register opened handle */
                    STEXTVIN_UnitArray[UnitIndex].UnitValidity = STEXTVIN_VALID_UNIT;

                    STTBX_Report((STTBX_REPORT_LEVEL_INFO, "Handle opened on device '%s'", DeviceName));
                }
            } /* End found unit unused */
        } /* End device valid */
    } /* End FirstInitDone */

    LeaveCriticalSection();

    return(ErrorCode);
} /* End fo STEXTVIN_Open() function */
开发者ID:henrryhe,项目名称:beijing-7101,代码行数:82,代码来源:evin.c


示例13: AppendFeature

	long SmtAnnoFclsAdoLayer::AppendFeature(const SmtFeature *pSmtFeature,bool bclone)
	{
		long lRet = SMT_ERR_NONE;
		//////////////////////////////////////////////////////////////////////////
		//db
		if (!IsOpen())
			if (!Open(m_szLayerTableName))
				return SMT_ERR_DB_OPER;

		int nGridID = 0;
		char  szAnnoBuf[TEMP_BUFFER_SIZE];
		int nClr = 0;
		double fAngle = 0.;

		Envelope env;
		const SmtGeometry *pGeom = pSmtFeature->GetGeometryRef();
		const SmtAttribute *pAtt = pSmtFeature->GetAttributeRef();
		const SmtStyle	*pStyle = pSmtFeature->GetStyle();

		pGeom->GetEnvelope(&env);
		
		m_SmtRecordset.AddNew();	
		m_SmtRecordset.PutCollect("ID",_variant_t(pSmtFeature->GetID()));
		m_SmtRecordset.PutCollect("mbr_xmin",_variant_t(env.MinX));
		m_SmtRecordset.PutCollect("mbr_ymin",_variant_t(env.MinY));
		m_SmtRecordset.PutCollect("mbr_xmax",_variant_t(env.MaxX));
		m_SmtRecordset.PutCollect("mbr_ymax",_variant_t(env.MaxY));
		m_SmtRecordset.PutCollect("grid_id",_variant_t(nGridID));
		//////////////////////////////////////////////////////////////////////////
		lRet = AppendStyle(pStyle);

		//////////////////////////////////////////////////////////////////////////
		lRet = AppendGeom(pGeom);

		//////////////////////////////////////////////////////////////////////////
		const SmtField *pFld = NULL;

		pFld = pAtt->GetFieldPtr(pAtt->GetFieldIndex("anno"));
		sprintf(szAnnoBuf,pFld->GetValueAsString());
		m_SmtRecordset.PutCollect("anno",_variant_t(szAnnoBuf));

		pFld = pAtt->GetFieldPtr(pAtt->GetFieldIndex("color"));
		nClr = pFld->GetValueAsInteger();
		m_SmtRecordset.PutCollect("color",_variant_t(nClr));

		pFld = pAtt->GetFieldPtr(pAtt->GetFieldIndex("angle"));
		fAngle = pFld->GetValueAsDouble();
		m_SmtRecordset.PutCollect("angle",_variant_t(fAngle));

		if (!m_SmtRecordset.Update()) 
		{
			SMT_SAFE_DELETE(pSmtFeature);
			return SMT_ERR_DB_OPER;
		}

		//mem
		m_pMemLayer->AppendFeature(pSmtFeature,bclone);
		CalEnvelope();

		return lRet;
	}
开发者ID:jsccl1988,项目名称:smartgis,代码行数:61,代码来源:sde_annofcls_adoveclayer.cpp


示例14: Open

bool File::OpenTemporaryFile(const std::wstring &dir)
{
	return Open(tmpnam(NULL), MODE_TEMP);
} 
开发者ID:Averroes,项目名称:urbackup_backend,代码行数:4,代码来源:file_fstream.cpp


示例15: cJoystick

cJoystickSDL::cJoystickSDL( const Uint32& index ) :
	cJoystick( index ),
	mJoystick( NULL )
{
	Open();
}
开发者ID:dogtwelve,项目名称:eepp,代码行数:6,代码来源:cjoysticksdl2.cpp


示例16: Open

	void VehicleDoor::isOpen::set(bool value) {
		if (value)
			Open();
		else 
			Close();
	}
开发者ID:Neproify,项目名称:ivmp,代码行数:6,代码来源:vVehicleDoor.cpp


示例17: QString

bool DTVChannel::SetChannelByString(const QString &channum)
{
    QString loc = LOC + QString("SetChannelByString(%1): ").arg(channum);
    LOG(VB_CHANNEL, LOG_INFO, loc);

    ClearDTVInfo();

    if (!IsOpen() && !Open())
    {
        LOG(VB_GENERAL, LOG_ERR, loc + "Channel object "
                "will not open, can not change channels.");

        return false;
    }

    if (!m_inputid)
        return false;

    uint mplexid_restriction;
    uint chanid_restriction;
    if (!IsInputAvailable(mplexid_restriction, chanid_restriction))
    {
        LOG(VB_GENERAL, LOG_INFO, loc +
            QString("Requested channel '%1' is on input '%2' "
                    "which is in a busy input group")
                .arg(channum).arg(m_inputid));

        return false;
    }

    // Fetch tuning data from the database.
    QString tvformat, modulation, freqtable, freqid, si_std;
    int finetune;
    uint64_t frequency;
    int mpeg_prog_num;
    uint atsc_major, atsc_minor, mplexid, chanid, tsid, netid;

    if (!ChannelUtil::GetChannelData(
        m_sourceid, chanid, channum,
        tvformat, modulation, freqtable, freqid,
        finetune, frequency,
        si_std, mpeg_prog_num, atsc_major, atsc_minor, tsid, netid,
        mplexid, m_commfree))
    {
        LOG(VB_GENERAL, LOG_ERR, loc + "Unable to find channel in database.");

        return false;
    }

    if ((mplexid_restriction && (mplexid != mplexid_restriction)) ||
        (!mplexid_restriction &&
         chanid_restriction && (chanid != chanid_restriction)))
    {
        LOG(VB_GENERAL, LOG_ERR, loc +
            QString("Requested channel '%1' is not available because "
                    "the tuner is currently in use on another transport.")
                .arg(channum));

        return false;
    }

    // If the frequency is zeroed out, don't use it directly.
    if (frequency == 0)
    {
        frequency = (freqid.toULongLong() + finetune) * 1000;
        mplexid = 0;
    }
    bool isFrequency = (frequency > 10000000);
    bool hasTuneToChan =
        !m_tuneToChannel.isEmpty() && m_tuneToChannel != "Undefined";

    // If we are tuning to a freqid, rather than an actual frequency,
    // we may need to set the frequency table to use.
    if (!isFrequency || hasTuneToChan)
        SetFreqTable(freqtable);

    // Set NTSC, PAL, ATSC, etc.
    SetFormat(tvformat);

    // If a tuneToChannel is set make sure we're still on it
    if (hasTuneToChan)
        Tune(m_tuneToChannel, 0);

    // Clear out any old PAT or PMT & save version info
    uint version = 0;
    if (genPAT)
    {
        version = (genPAT->Version()+1) & 0x1f;
        delete genPAT; genPAT = NULL;
        delete genPMT; genPMT = NULL;
    }

    bool ok = true;
    if (m_externalChanger.isEmpty())
    {
        if (IsIPTV())
        {
            int chanid = ChannelUtil::GetChanID(m_sourceid, channum);
            IPTVTuningData tuning = ChannelUtil::GetIPTVTuningData(chanid);
            if (!Tune(tuning, false))
//.........这里部分代码省略.........
开发者ID:kmdewaal,项目名称:mythtv,代码行数:101,代码来源:dtvchannel.cpp


示例18: Open

bool
FileDescriptor::OpenReadOnly(const char *pathname)
{
  return Open(pathname, O_RDONLY);
}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:5,代码来源:FileDescriptor.cpp


示例19: Open

	/** Attaches <code>aCompoundControl</code> to the layout manager.
		Is normally not called manually since <code>CCoeControl::SetLayoutManagerL()</code>
		calls this function.
		Once a compound control is attached to a layout manager, the layout manager owns itself.
		@see Detach
		@see CCoeControl::SetLayoutManagerL
		@param aCompoundControl The compound control.
		@leave KErrOverflow
	*/
void CLayoutTest::AttachL(CCoeControl& aCompoundControl)
	{
	Open();
	iCtrlArray.Append(&aCompoundControl);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:14,代码来源:TCONE5STEP.CPP


示例20: main

main( int argc, char **argv )
{
    int colors;
    struct {
	long nplanes;
	long pbytes;
	long across;
	long down;
	long npics;
	long xsize;
	long ysize;
    } pdat;
    long pbytes;	/* Bytes of data in a plane */
    int i, cnt;
    BitMapHeader bmhd;
    struct IFFHandle *iff;
    long camg = HIRES|LACE;
    int tiles=0;
    char **planes;

    if(argc != 3){
	fprintf(stderr, "Usage: %s source destination\n", argv[0]);
	exit(1);
    }

#if defined(_DCC) || defined(__GNUC__)
    IFFParseBase = OpenLibrary( "iffparse.library", 0 );
    if( !IFFParseBase ) {
	error( "unable to open iffparse.library" );
	exit( 1 );
    }
#endif

    /* First, count the files in the file */
    if( fopen_text_file( argv[1], "r" ) != TRUE )
    {
	perror( argv[1] );
	return( 1 );
    }

    nplanes = 0;
    i = colorsinmap-1; /*IFFScreen.Colors - 1; */
    while( i != 0 )
    {
	nplanes++;
	i >>= 1;
    }

    planes = malloc( nplanes * sizeof( char * ) );
    if( planes == 0 )
    {
	error( "can not allocate planes pointer" );
	exit( 1 );
    }

    while( read_text_tile( pixels ) == TRUE )
	++tiles;
    fclose_text_file();

    IFFScreen.Width = COLS * TILE_X;
    IFFScreen.Height = ROWS * TILE_Y;

    pbytes = (COLS * ROWS * TILE_X + 15) / 16 * 2 * TILE_Y;

    for( i = 0; i < nplanes; ++i )
    {
	planes[ i ] = calloc( 1, pbytes );
	if( planes[ i ] == 0 )
	{
	    error( "can not allocate planes pointer" );
	    exit( 1 );
	}
    }

    /* Now, process it */
    if( fopen_text_file( argv[1], "r" ) != TRUE )
    {
	perror( argv[1] );
	return( 1 );
    }

    iff = AllocIFF();
    if( !iff )
    {
	error( "Can not allocate IFFHandle" );
	return( 1 );
    }

    iff->iff_Stream = Open( argv[2], MODE_NEWFILE );
    if( !iff->iff_Stream )
    {
	error( "Can not open output file" );
	return( 1 );
    }

    InitIFFasDOS( iff );
    OpenIFF( iff, IFFF_WRITE );

    PushChunk( iff, ID_BMAP, ID_FORM, IFFSIZE_UNKNOWN );

//.........这里部分代码省略.........
开发者ID:Agyar,项目名称:NetHack,代码行数:101,代码来源:txt2iff.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ OpenBlob函数代码示例发布时间:2022-05-30
下一篇:
C++ OpcUa_InitializeStatus函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap