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

C++ read_id函数代码示例

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

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



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

示例1: return

PackageCanvas * PackageCanvas::read(char * & st, UmlCanvas * canvas, char * k) {
  if (!strcmp(k, "packagecanvas_ref"))
    return ((PackageCanvas *) dict_get(read_id(st), "packagecanvas", canvas));
  else if (!strcmp(k, "packagecanvas")) {
    int id = read_id(st);
    BrowserNode * br = BrowserPackage::read_ref(st);
    UmlColor color = UmlDefaultColor;
    Uml3States in_tab = UmlDefaultState;
    ShowContextMode context = DefaultShowContextMode;
    Uml3States show_stereotype_properties = UmlDefaultState;;
    
    k = read_keyword(st);
    
    if (!strcmp(k, "name_in_tab")) {
      in_tab = state(read_keyword(st));
      k = read_keyword(st);
    }
    
    if (!strcmp(k, "show_context_mode")) {
      context = context_mode(read_keyword(st));
      k = read_keyword(st);
    }

    if (!strcmp(k, "show_stereotype_properties")) {
      show_stereotype_properties = state(read_keyword(st));
      k = read_keyword(st);
    }

    read_color(st, "color", color, k);
    
    if (strcmp(k, "xyzwh"))
      wrong_keyword(k, "xyzwh");
    
    int x = (int) read_double(st);
    PackageCanvas * result =
      new PackageCanvas(br, canvas, x, (int) read_double(st), id);
    
    read_zwh(st, result);
    
    if (read_file_format() >= 58) {
      k = read_keyword(st);
      result->read_stereotype_property(st, k);	// updates k
      if (strcmp(k, "end"))
	wrong_keyword(k, "end");
    }
    
    result->name_in_tab = in_tab;
    result->show_context_mode = context;
    result->show_stereotype_properties = show_stereotype_properties;
    result->itscolor = color;
    result->check_size();
    result->set_center100();
    result->show();
    result->check_stereotypeproperties();
    
    return result;
  }
  else
    return 0;
}
开发者ID:kralf,项目名称:bouml,代码行数:60,代码来源:PackageCanvas.cpp


示例2: return

AssocContainCanvas * AssocContainCanvas::read(char * & st, UmlCanvas * canvas, char * k)
{
  if (!strcmp(k, "containcanvas_ref"))
    return ((AssocContainCanvas *) dict_get(read_id(st), "contain canvas", canvas));
  else if (!strcmp(k, "containcanvas")) {
    int id = read_id(st);    
    LineGeometry geo;
    bool fixed;
    
    k = read_keyword(st);	// may read id
    if (!strcmp(k, "geometry")) {
      geo = line_geometry(read_keyword(st));
      k = read_keyword(st);
      if (! strcmp(k, "unfixed")) {
	k = read_keyword(st);
	fixed = FALSE;
      }
      else
	fixed = TRUE;
    }
    else {
      geo = NoGeometry;
      fixed = FALSE;
    }
    
    float dbegin;
    float dend;

    if (! strcmp(k, "decenter_begin")) {
      dbegin = read_double(st) / 1000;
      k = read_keyword(st);
    }
    else
      dbegin = -1;

    if (! strcmp(k, "decenter_end")) {
      dend = read_double(st) / 1000;
      k = read_keyword(st);
    }
    else
      dend = -1;
    
    unread_keyword(k, st);
    
    AssocContainCanvas * r = (AssocContainCanvas *)
      read_list(st, canvas, UmlContain, geo, fixed, dbegin, dend, id, &make);
    
    // remove association between components available in the
    // 2.0 deployment diagrams
    if (r->begin->type() == UmlComponent)
      Undefined.append(r);
    else if (read_file_format() == 30)
      // to remove redondant transitions made by release 2.22
      RelsToCheck.append(r);
    
    return r;
  }
  else
    return 0;
}
开发者ID:SciBoy,项目名称:douml,代码行数:60,代码来源:AssocContainCanvas.cpp


示例3: read_id

void BrowserNode::read(char * & st, char * & k, int id) {
  if (in_lib_import()) {
    original_id = id;
    is_read_only = TRUE;
    
    if (! strcmp(k, "oid")) {
      // a sub lib is imported as a part of the imported lib
      (void) read_id(st);
      k = read_keyword(st);
    }
  }
  else if (! strcmp(k, "oid")) {
    original_id = read_id(st);
    is_read_only = TRUE;
    k = read_keyword(st);
  }
  
  HaveKeyValueData::read(st, k);
  
  if (!strcmp(k, "comment")) {
    comment = read_string(st);
    k = read_keyword(st);
  }
  
  is_new = FALSE;
}
开发者ID:SciBoy,项目名称:douml,代码行数:26,代码来源:BrowserNode.cpp


示例4: return

DeploymentNodeCanvas * DeploymentNodeCanvas::read(char * & st, UmlCanvas * canvas, char * k) {
  if (!strcmp(k, "deploymentnodecanvas_ref"))
    return ((DeploymentNodeCanvas *) dict_get(read_id(st), "deploymentnodecanvas", canvas));
  else if (!strcmp(k, "deploymentnodecanvas")) {
    int id = read_id(st);
    BrowserNode * br = BrowserDeploymentNode::read_ref(st);
    QString iname;
    Uml3States write_horizontally = UmlDefaultState;
    Uml3States show_stereotype_properties = UmlDefaultState;
    
    k = read_keyword(st);
    
    if (!strcmp(k, "name")) {
      iname = read_string(st);
      k = read_keyword(st);
    }
    if (!strcmp(k, "write_horizontally") ||
	!strcmp(k, "write_horizontaly")) {
      write_horizontally = state(read_keyword(st));
      k = read_keyword(st);
    }
    if (!strcmp(k, "show_stereotype_properties")) {
      show_stereotype_properties = state(read_keyword(st));
      k = read_keyword(st);
    }
    
    UmlColor color = UmlDefaultColor;
    
    read_color(st, "color", color, k);
    
    if (strcmp(k, "xyzwh"))
      wrong_keyword(k, "xyzwh");
    
    int x = (int) read_double(st);
    DeploymentNodeCanvas * result =
      new DeploymentNodeCanvas(br, canvas, x, (int) read_double(st), id);
    
    read_zwh(st, result);
    
    if (read_file_format() >= 58) {
      k = read_keyword(st);
      result->read_stereotype_property(st, k);	// updates k
      if (strcmp(k, "end"))
	wrong_keyword(k, "end");
    }
    
    result->iname = iname;
    result->write_horizontally = write_horizontally;
    result->show_stereotype_properties = show_stereotype_properties;
    result->itscolor = color;
    result->check_size();
    result->set_center100();
    result->show();
    result->check_stereotypeproperties();
    
    return result;
  }
  else
    return 0;
}
开发者ID:SciBoy,项目名称:douml,代码行数:60,代码来源:DeploymentNodeCanvas.cpp


示例5: return

SubjectCanvas * SubjectCanvas::read(char * & st, UmlCanvas * canvas, char * k)
{
  if (!strcmp(k, "subject_ref"))
    return (SubjectCanvas *) dict_get(read_id(st), "subject", canvas);
  else if (!strcmp(k, "subject")) {
    int id = read_id(st);
    SubjectCanvas * result = new SubjectCanvas(canvas, 0, 0, id);
    
    result->name = toUnicode(read_string(st));
    
    k = read_keyword(st);
    read_color(st, "color", result->itscolor, k);
    
    if (strcmp(k, "xyzwh"))
      wrong_keyword(k, "xyzwh");
    
    read_xyzwh(st, result);
    result->check_size();
    result->width_scale100 = result->width();
    result->height_scale100 = result->height();
    result->set_center100();
    result->show();
    return result;
  }
  else
    return 0;
}
开发者ID:SciBoy,项目名称:douml,代码行数:27,代码来源:SubjectCanvas.cpp


示例6: return

NoteCanvas * NoteCanvas::read(char *& st, UmlCanvas * canvas, char * k)
{
    if (!strcmp(k, "note_ref"))
        return (NoteCanvas *) dict_get(read_id(st), "note", canvas);
    else if (!strcmp(k, "note")) {
        int id = read_id(st);
        NoteCanvas * result = new NoteCanvas(canvas, 0, 0, id);

        result->read_internal(st);
        return result;
    }
    else
        return 0;
}
开发者ID:harmegnies,项目名称:douml,代码行数:14,代码来源:NoteCanvas.cpp


示例7: wd_fdc_seek_verify_read_id

static void
wd_fdc_seek_verify_read_id( wd_fdc *f )
{
  fdd_t *d = f->current_drive;
  int i;
  f->read_id = 1;

  event_remove_type( fdc_event );
  if( f->id_mark == WD_FDC_AM_NONE ) {
    while( f->rev ) {
      i = d->disk.i >= d->disk.bpt ? 0 : d->disk.i;	/* start position */
      if( !read_id( f ) ) {
	if( f->id_track != f->track_register ) {
	  f->status_register |= WD_FDC_SR_RNF;
	}
      } else
        f->id_mark = WD_FDC_AM_NONE;
      i = d->disk.bpt ? ( d->disk.i - i ) * 200 / d->disk.bpt : 200;
      if( i > 0 ) {
        event_add_with_data( tstates + i *		/* i * 1/20 revolution */
			   machine_current->timings.processor_speed / 1000,
			   fdc_event, f );
        return;
      } else if( f->id_mark != WD_FDC_AM_NONE )
        break;
    }
    if( f->id_mark == WD_FDC_AM_NONE )
      f->status_register |= WD_FDC_SR_RNF;
  }
  f->state = WD_FDC_STATE_NONE;
  f->status_register &= ~WD_FDC_SR_BUSY;
  wd_fdc_set_intrq( f );
  f->read_id = 0;
}
开发者ID:vamposdecampos,项目名称:fuse-emulator-svn,代码行数:34,代码来源:wd_fdc.c


示例8: start_read_diag

static void
start_read_diag( upd_fdc *f )
{
  int i;
  
  if( !f->read_id ) {
    f->rev = 2;
    f->read_id = 1;
  }
  if( f->rev ) {
    i = f->current_drive->disk.i >= f->current_drive->disk.bpt ?
    	0 : f->current_drive->disk.i;			/* start position */
    if( read_id( f ) != 2 )
      f->rev = 0;
    i = f->current_drive->disk.bpt ? 
      ( f->current_drive->disk.i - i ) * 200 / f->current_drive->disk.bpt : 200;
    if( i > 0 ) {
      event_add_with_data( tstates + i *		/* i * 1/20 revolution */
			 machine_current->timings.processor_speed / 1000,
			 fdc_event, f );
      return;
    }
  }
  f->read_id = 0;
  if( f->id_mark == UPD_FDC_AM_NONE ) {
    f->status_register[0] |= UPD_FDC_ST0_INT_ABNORM;
    f->status_register[1] |= UPD_FDC_ST1_EOF_CYLINDER;
    goto abort_read_diag;
  }
  if( f->id_track != f->data_register[1] || f->id_sector != f->data_register[3] || 
    f->data_register[2] != f->id_head ) {
    f->status_register[1] |= UPD_FDC_ST1_NO_DATA;
  }

  if( f->id_track != f->data_register[1] ) {		/*FIXME UPD765 set it always? */
    f->status_register[2] |= UPD_FDC_ST2_WRONG_CYLINDER;
    if( f->id_track == 0xff )
      f->status_register[2] |= UPD_FDC_ST2_BAD_CYLINDER;
  }

  if( read_datamark( f ) > 0 ) {	/* not found */
    f->status_register[0] |= UPD_FDC_ST0_INT_ABNORM;
    goto abort_read_diag;
  }

  f->main_status |= UPD_FDC_MAIN_DATAREQ | UPD_FDC_MAIN_DATA_READ;
  f->data_offset = 0;
  event_remove_type( timeout_event );
  event_add_with_data( tstates + 4 *			/* 2 revolution: 2 * 200 / 1000  */
		       machine_current->timings.processor_speed / 10,
		       timeout_event, f );
  return;

abort_read_diag:
    f->state = UPD_FDC_STATE_RES;	/* end of execution phase */
    f->cycle = f->cmd->res_length;
    f->main_status &= ~UPD_FDC_MAIN_EXECUTION;
    f->intrq = UPD_INTRQ_RESULT;
    cmd_result( f );
}
开发者ID:jacadym,项目名称:fuse-emulator,代码行数:60,代码来源:upd_fdc.c


示例9: read_val

/* Read out a given typed element */
static jvalue
read_val(unsigned char **pp, HprofType ty)
{
    jvalue        val;
    static jvalue empty_val;

    val = empty_val;
    switch ( ty ) {
        case 0:
        case HPROF_ARRAY_OBJECT:
        case HPROF_NORMAL_OBJECT:
            val.i = read_id(pp);
            break;
        case HPROF_BYTE:
        case HPROF_BOOLEAN:
            val.b = read_u1(pp);
            break;
        case HPROF_CHAR:
        case HPROF_SHORT:
            val.s = read_u2(pp);
            break;
        case HPROF_FLOAT:
        case HPROF_INT:
            val.i = read_u4(pp);
            break;
        case HPROF_DOUBLE:
        case HPROF_LONG:
            val.j = read_u8(pp);
            break;
        default:
            HPROF_ERROR(JNI_TRUE, "bad type number");
            break;
    }
    return val;
}
开发者ID:AllenWeb,项目名称:openjdk-1,代码行数:36,代码来源:hprof_check.c


示例10: seek_id

static int
seek_id( upd_fdc *f )
{
  int r;

  f->status_register[2] &= ~( UPD_FDC_ST2_WRONG_CYLINDER |
			      UPD_FDC_ST2_BAD_CYLINDER );
  r = read_id( f );
  if( r != 0 ) return r;		/* not found any good id */

  if( f->id_track != f->data_register[1] ) {
    f->status_register[2] |= UPD_FDC_ST2_WRONG_CYLINDER;
    if( f->id_track == 0xff )
      f->status_register[2] |= UPD_FDC_ST2_BAD_CYLINDER;
    return 3;
  }

  if( f->id_sector == f->data_register[3] && 
      f->id_head == f->data_register[2] ) {

    if( f->id_length != f->data_register[4] ) {
      f->status_register[1] |= UPD_FDC_ST1_NO_DATA;
      return 3;
    }

    return 0;
  }
  f->status_register[1] |= UPD_FDC_ST1_NO_DATA;
  return 3;
}
开发者ID:jacadym,项目名称:fuse-emulator,代码行数:30,代码来源:upd_fdc.c


示例11: ack_skip

    static size_t ack_skip(Buffer& buf)
    {
      const size_t len = buf.pop_front();
      for (size_t i = 0; i < len; ++i)
	read_id(buf);
      return len;
    }
开发者ID:akoshelnik,项目名称:openvpn3,代码行数:7,代码来源:relack.hpp


示例12: return

StereotypePropertiesCanvas *
StereotypePropertiesCanvas::read(char *& st, UmlCanvas * canvas, char * k)
{
    if (!strcmp(k, "stereotypeproperties_ref"))
        return (StereotypePropertiesCanvas *) dict_get(read_id(st), "stereotypeproperties", canvas);
    else
        return 0;
}
开发者ID:harmegnies,项目名称:douml,代码行数:8,代码来源:StereotypePropertiesCanvas.cpp


示例13: return

SdDurationCanvas * SdDurationCanvas::read(char * & st, UmlCanvas * canvas, char * k)
{
  if (!strcmp(k, "durationcanvas_ref"))
    return ((SdDurationCanvas *) dict_get(read_id(st), "durationcanvas", canvas));
  else if (!strcmp(k, "durationcanvas")) {
    int id = read_id(st);
    SdObjCanvas * o;
    
    k = read_keyword(st);
    
    if ((o = SdClassInstCanvas::read(st, canvas, k)) == 0)
      wrong_keyword(st, k);
    
    return read_internal(st, canvas, id, o->get_life_line());
  }
  else
    return 0;
}
开发者ID:kralf,项目名称:bouml,代码行数:18,代码来源:SdDurationCanvas.cpp


示例14: read

    // copy ACKs from buffer to self
    void read(Buffer& buf)
    {
      const size_t len = buf.pop_front();
      for (size_t i = 0; i < len; ++i)
	{
	  const id_t id = read_id(buf);
	  data.push_back(id);
	}
    }
开发者ID:akoshelnik,项目名称:openvpn3,代码行数:10,代码来源:relack.hpp


示例15: ack

    static size_t ack(REL_SEND& rel_send, Buffer& buf, const bool live)
    {
      const size_t len = buf.pop_front();
      for (size_t i = 0; i < len; ++i)
	{
	  const id_t id = read_id(buf);
	  if (live)
	    rel_send.ack(id);
	}
      return len;
    }
开发者ID:akoshelnik,项目名称:openvpn3,代码行数:11,代码来源:relack.hpp


示例16: return

ArtifactCanvas * ArtifactCanvas::read(char * & st, UmlCanvas * canvas,
					char * k)
{
  if (!strcmp(k, "artifactcanvas_ref") || 
      ((read_file_format() < 20) && !strcmp(k, "componentcanvas_ref")))
    return ((ArtifactCanvas *) dict_get(read_id(st), "artifactcanvas", canvas));
  else if (!strcmp(k, "artifactcanvas") || 
	   ((read_file_format() < 20) && !strcmp(k, "componentcanvas"))) {
    int id = read_id(st);
    BrowserArtifact * br = BrowserArtifact::read_ref(st, read_keyword(st));
    ArtifactCanvas * result = new ArtifactCanvas(canvas, id);
    
    result->browser_node = br;
    connect(br->get_data(), SIGNAL(changed()), result, SLOT(modified()));
    connect(br->get_data(), SIGNAL(deleted()), result, SLOT(deleted()));

    k = read_keyword(st);
    
    read_color(st, "color", result->itscolor, k);	// updates k
    
    if (strcmp(k, "xyz"))
      wrong_keyword(k, "xyz");
    read_xyz(st, result);
    
    if (read_file_format() >= 58) {
      k = read_keyword(st);
      result->read_stereotype_property(st, k);	// updates k
      
      if (strcmp(k, "end"))
	wrong_keyword(k, "end");
    }
    
    result->compute_size();
    result->set_center100();
    result->show();
    result->check_stereotypeproperties();
    return result;
  }
  else 
    return 0;
}
开发者ID:kralf,项目名称:bouml,代码行数:41,代码来源:ArtifactCanvas.cpp


示例17: cgiMain

/***************************************************************************
  Function: cgiMain
  Description: 
  Input:  
  Output: 
  Return: 0 OK, other Error
  Others:  none
***************************************************************************/
int cgiMain()
{
    char account[FEATURE_GDGL_ACCOUNT_MAX_LEN + 1]; //16 + terminating null
	char password[FEATURE_GDGL_PASSWD_MAX_LEN + 1]; //16 + terminating null
	char gateway_id[FEATURE_GDGL_ID_LEN + 1]; //12 + terminating null
	char gateway_alias[FEATURE_GDGL_ACCOUNT_MAX_LEN + 1];
	char gateway_passwd[FEATURE_GDGL_PASSWD_MAX_LEN + 1];
	cgiFormResultType cgi_re;
	int res;

	cgiHeaderContentType("application/json"); //MIME

    // Read ID
    res = read_id(gateway_id);
	if (res != 0) {
		client_admin_response("noid", res, clientAdminResultStr[res]);
		return res;
	}
	
	// Read alias
	res = read_alias(gateway_alias);
	if (res != 0) {
		client_admin_response(gateway_id, res, clientAdminResultStr[res]);
		return res;
	}

    // Read password
	res = read_password(gateway_passwd);
	if (res != 0) {
		client_admin_response(gateway_id, res, clientAdminResultStr[res]);
		return res;
	}

    // Check account
    cgi_re = cgiFormString("account", account, FEATURE_GDGL_ACCOUNT_MAX_LEN + 1);
	res = check_account(cgi_re, account, gateway_id, gateway_alias);
	if (res != 0) {
		client_admin_response(gateway_id, res, clientAdminResultStr[res]);
		return res;
	}

	// Check password
	cgi_re = cgiFormString("password", password, FEATURE_GDGL_PASSWD_MAX_LEN + 1);
	res = check_password(cgi_re, password, gateway_passwd);
	if (res != 0) {
		client_admin_response(gateway_id, res, clientAdminResultStr[res]);
		return res;
	}

    // account & password all right	
    client_admin_response(gateway_id, clientAdminSuccess, clientAdminResultStr[clientAdminSuccess]);
	return 0;
}
开发者ID:yanlunyao,项目名称:gateway,代码行数:61,代码来源:clientLogin.c


示例18: return

TextCanvas * TextCanvas::read(char *& st, UmlCanvas * canvas, char * k)
{
    if (!strcmp(k, "textcanvas_ref"))
        return ((TextCanvas *) dict_get(read_id(st), "textcanvas", canvas));
    else if (!strcmp(k, "textcanvas")) {
        int id = read_id(st);
        QString text = read_string(st);
        UmlFont font;
        UmlColor fg_c = UmlBlack;
        UmlColor bg_c = UmlTransparent;

        k = read_keyword(st);
        read_font(st, "font", font, k);
        read_color(st, "fg", fg_c, k);
        read_color(st, "bg", bg_c, k);

        if (strcmp(k, "xyzwh"))
            wrong_keyword(k, "xyzwh");

        int x = (int) read_double(st);

        TextCanvas * result =
                new TextCanvas(canvas, x, (int) read_double(st), id);

        read_zwh(st, result);
        result->width_scale100 = result->width();
        result->height_scale100 = result->height();
        result->set_center100();
        result->text = text;
        result->itsfont = font;
        result->fg_c = fg_c;
        result->bg_c = bg_c;
        result->show();

        return result;
    }
    else
        return 0;
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:39,代码来源:TextCanvas.cpp


示例19: read_id

std::pair<ChunkId, std::string> Parser::read_chunk(std::istream &stream)
{
    // LastPass blob chunk is made up of 4-byte ID, big endian 4-byte size and payload of that size
    // Example:
    //   0000: 'IDID'
    //   0004: 4
    //   0008: 0xDE 0xAD 0xBE 0xEF
    //   000C: --- Next chunk ---

    auto id = read_id(stream);
    auto payload = read_payload(stream, read_size(stream));
    return std::make_pair(id, payload);
}
开发者ID:detunized,项目名称:lastpass-cpp,代码行数:13,代码来源:parser.cpp


示例20: read_ids

void read_ids() {
	FILE * fp;
	fp = fopen("../ids_table.txt", "r");
	if (fp == NULL)
		exit(EXIT_FAILURE);

	while (!feof(fp)) {
		read_id(fp);
	}

	fclose(fp);

	ids = inverse_node_s(ids, NULL);
}
开发者ID:privategenocomputation,项目名称:privategenocomputation,代码行数:14,代码来源:genoreader.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ read_if_needed_函数代码示例发布时间:2022-05-30
下一篇:
C++ read_history函数代码示例发布时间: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