当前位置: 首页>>代码示例>>C++>>正文


C++ TSTR::data方法代码示例

本文整理汇总了C++中TSTR::data方法的典型用法代码示例。如果您正苦于以下问题:C++ TSTR::data方法的具体用法?C++ TSTR::data怎么用?C++ TSTR::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TSTR的用法示例。


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

示例1: FormatObjectDisplay

/*===========================================================================*\
 | Dialog Procs and related functions
\*===========================================================================*/
void FormatObjectDisplay(int i, ReferenceMaker* rm, bool showaddress, TSTR& buf) {
   TSTR str;
   if (rm) {
      rm->GetClassName(str);
      buf.printf(_T("%d: %s (0x%08x) "), i, str.data(), rm->SuperClassID());
      if (str == _T("Node")) 
			{
         INode* node = (INode*)rm;
         str = buf;
         buf.printf(_T("%s \"%s\""), str.data(), node->GetName());
      }
			else 
			{
				str = buf;
				if (rm->ClassID() == Class_ID(0,0))
					buf.printf(_T("%s (0,0)"), str.data());
				else
					buf.printf(_T("%s (0x%08x, 0x%08x)"), str.data(), rm->ClassID().PartA(), rm->ClassID().PartB());
			}
      if (showaddress) {
         str = buf;
         buf.printf(_T("%s at 0x%08x"), str.data(), rm);
      }
   }
   else
      buf.printf(_T("%d: NULL"), i);
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:30,代码来源:refcheck.cpp

示例2: MAXException

void Unreal3DExport::WriteModel()
{
    // Progress
        pInt->ProgressUpdate(Progress, FALSE, GetString(IDS_INFO_WRITE));

        // Open data file
        fMesh = _tfopen(ModelFileName,_T("wb"));
        if( !fMesh ) 
        {
            ProgressMsg.printf(GetString(IDS_ERR_FMODEL),ModelFileName);
            throw MAXException(ProgressMsg.data());
        }

        // Open anim file
        fAnim = _tfopen(AnimFileName,_T("wb"));
        if( !fAnim )
        {
            ProgressMsg.printf(GetString(IDS_ERR_FANIM),AnimFileName);
            throw MAXException(ProgressMsg.data());
        }
        
        // data headers
        hData.NumPolys = Tris.Count();
        hData.NumVertices = VertsPerFrame;

        // anim headers
        hAnim.FrameSize = VertsPerFrame * sizeof(FMeshVert); 
        hAnim.NumFrames = FrameCount;


        // Progress
        CheckCancel();
        pInt->ProgressUpdate(Progress, FALSE, GetString(IDS_INFO_WMESH));
        

        // Write data
        fwrite(&hData,sizeof(FJSDataHeader),1,fMesh);
        if( Tris.Count() > 0 )
        {
            fwrite(Tris.Addr(0),sizeof(FJSMeshTri),Tris.Count(),fMesh);
        }
        Progress += U3D_PROGRESS_WMESH;

        // Progress
        CheckCancel();
        pInt->ProgressUpdate(Progress, FALSE, GetString(IDS_INFO_WANIM));

        // Write anim
        fwrite(&hAnim,sizeof(FJSAnivHeader),1,fAnim);
        if( Verts.Count() > 0 )
        {
            fwrite(Verts.Addr(0),sizeof(FMeshVert),Verts.Count(),fAnim);
        }
        Progress += U3D_PROGRESS_WANIM;
}
开发者ID:roman-dzieciol,项目名称:Unreal3DExport,代码行数:55,代码来源:Unreal3DExport.cpp

示例3: PaintCellNameVertically

void WeightTableWindow::PaintCellNameVertically(HDC hdc, int x, int y, int height, BOOL sel, TSTR name)
	{
	HBRUSH textBackground;
	DWORD textColor;
	DWORD textBKColor;
	
	if (sel)
		{
		
		textBackground = GetSysColorBrush(COLOR_HIGHLIGHT);
		textColor = GetSysColor(COLOR_HIGHLIGHTTEXT) ;
		textBKColor = GetSysColor(COLOR_HIGHLIGHT) ;
		SelectObject(hdc, hFixedFontBold);
 		}
	else
		{
		textBackground = ColorMan()->GetBrush(kWindow );
		textColor = ColorMan()->GetColor(kWindowText ) ;
		textBKColor = ColorMan()->GetColor(kWindow ) ;
		SelectObject(hdc, hFixedFont);
		}
	SetTextColor(hdc, textColor);
	SelectObject(hdc, textBackground);
	SetBkColor(hdc,  textBKColor);
	SelectObject(hdc,pBackPen);
	Rectangle(hdc, x,  y,x+textHeight+1,y+height+1);
	int th = textHeight -4;
	if ((th * name.Length()) <= height)
		{
		y = height - textHeight+1;

		for	(int i= (name.Length()-1); i >= 0 ; i--)
			{
			const TCHAR *t = &name.data()[i];
			int offset = textHeight/4;
			TextOut(hdc, x+offset,y,t,1);
			y -= th;
			}
		}
	else
		{
		y = 1;

		for	(int i= 0 ; i < name.Length() ; i++)
			{
			const TCHAR *t = &name.data()[i];
			int offset = textHeight/4;
			TextOut(hdc, x+offset,y,t,1);
			y += th;
			}

		}

	}
开发者ID:artemeliy,项目名称:inf4715,代码行数:54,代码来源:weightTablePaints.cpp

示例4: getFactoryDefaultFilePath

int MarketDefaultTest::Tester::testFilePresent(const TCHAR* file)
{
	mStatus.message(kInfoMessage, _T("Starting testFilePresent %s\r\n"), file);

	// Now try again with a file that should exist
	TSTR path = getFactoryDefaultFilePath(file);
	DeleteFile(path);

	TSTR expected = getDefaultFilePath(file); 
	DeleteFile(expected);

	if (!createFile(expected, &file1))
		return 1;

	char* valueSrc;
	long lengthSrc;
	int foundSrc = getFileContents(expected, valueSrc, lengthSrc);

	int errors = 0;

	// Now copy it to the defaults directory
	TSTR newPath = GetMarketDefaultsFileName(file);
	if (newPath != expected) {
		mStatus.message(kErrorMessage, _T("%s was copied to the wrong file\r\n")
									   _T("    Expected: %s\r\n")
									   _T("    Got: %s\r\n"),
			path.data(), expected.data(), newPath.data());
		++errors;
	}

	char* valueDst;
	long lengthDst;
	int foundDst = getFileContents(expected, valueDst, lengthDst);

	if (!filesAreEqual(foundSrc, valueSrc, lengthSrc,
			foundDst, valueDst, lengthDst)) {
		mStatus.message(kErrorMessage, _T("%s was changed by copy\r\n"),
			expected.data());
		++errors;
	}

	// Clean up
	delete[] valueSrc;
	delete[] valueDst;

	DeleteFile(path);
	DeleteFile(expected);
	DeleteFile(newPath);

	mStatus.message(kInfoMessage, _T("Finished testFilePresent %s - %d error(s)\r\n\r\n"), file, errors);

	return errors;
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:53,代码来源:tester.cpp

示例5: MaxMsgBox

void Unreal3DExport::ShowSummary()
{
    
    // Progress
    pInt->ProgressUpdate(Progress);

    // Display Summary
    if( bShowPrompts )
    {
        ProgressMsg.printf(GetString(IDS_INFO_SUMMARY)
            , hAnim.NumFrames
            , hData.NumPolys
            , hData.NumVertices);

        if( bMaxResolution )
        {
            TSTR buf;
            buf.printf(GetString(IDS_INFO_DIDPRECISION)
                , FileName);
            ProgressMsg += buf;
        }

        MaxMsgBox(pInt->GetMAXHWnd(),ProgressMsg.data(),ShortDesc(),MB_OK|MB_ICONINFORMATION);
    }
}
开发者ID:roman-dzieciol,项目名称:Unreal3DExport,代码行数:25,代码来源:Unreal3DExport.cpp

示例6: UpdateLayerDisplay

void plMultipassMtlDlg::UpdateLayerDisplay() 
{
    int numlayers = fPBlock->GetInt(kMultCount);

    fNumTexSpin->SetValue(numlayers, FALSE);

    int i;
    for (i = 0; i < numlayers && i < NSUBMTLS; i++)
    {
        Mtl *m = fPBlock->GetMtl(kMultPasses, curTime, i);
        TSTR nm;
        if (m) 
            nm = m->GetName();
        else 
            nm = "None";
        fLayerBtns[i]->SetText(nm.data());
        
        ShowWindow(GetDlgItem(fhRollup, kLayerID[i].layerID), SW_SHOW);
        ShowWindow(GetDlgItem(fhRollup, kLayerID[i].activeID), SW_SHOW);
        SetCheckBox(fhRollup, kLayerID[i].activeID, fPBlock->GetInt(kMultOn, curTime, i));  
    }

    for (i = numlayers; i < NSUBMTLS; i++)
    {
        ShowWindow(GetDlgItem(fhRollup, kLayerID[i].layerID), SW_HIDE);
        ShowWindow(GetDlgItem(fhRollup, kLayerID[i].activeID), SW_HIDE);
    }
}
开发者ID:,项目名称:,代码行数:28,代码来源:

示例7: FillBoneController

static void FillBoneController(Exporter* exporter, NiBSBoneLODControllerRef boneCtrl, INode *node)
{
   for (int i=0; i<node->NumberOfChildren(); i++) 
   {
      INode * child = node->GetChildNode(i);
      FillBoneController(exporter, boneCtrl, child);

      TSTR upb;
      child->GetUserPropBuffer(upb);
      if (!upb.isNull())
      {
         // Check for bonelod and add bones to bone controller
         stringlist tokens = TokenizeString(upb.data(), "\r\n", true);
         for (stringlist::iterator itr = tokens.begin(); itr != tokens.end(); ++itr) {
            string& line = (*itr);
            if (wildmatch("*#", line)) { // ends with #
               stringlist bonelod = TokenizeString(line.c_str(), "#", true);
               for (stringlist::iterator token = bonelod.begin(); token != bonelod.end(); ++token) {
                  if (  wildmatch("??BoneLOD", (*token).c_str())) {
                     if (++token == bonelod.end()) 
                        break;
                     if (strmatch("Bone", (*token).c_str())) {
                        if (++token == bonelod.end()) 
                           break;
                        int group = 0;
                        std::stringstream str (*token);
                        str >> group;
                        boneCtrl->AddNodeToGroup(group, exporter->getNode(child));
                     }
                  }
               }
            }
         }
      }
开发者ID:ElliotWood,项目名称:max_nif_plugin,代码行数:34,代码来源:Mesh.cpp

示例8: exportUPB

bool Exporter::exportUPB(NiNodeRef &root, INode *node)
{
	bool ok = false;
	if (!mUserPropBuffer)
		return ok;

	// Write the actual UPB sans any np_ prefixed strings
	TSTR upb;
	node->GetUserPropBuffer(upb);
	if (!upb.isNull())
	{
		tstring line;
		tistringstream istr(upb.data(), ios_base::out);
		tostringstream ostr;
		while (!istr.eof()) {
			std::getline(istr, line);
			if (!line.empty() && 0 != line.compare(0, 3, TEXT("np_")))
				ostr << line << endl;
		}
		if (!ostr.str().empty())
		{
			NiStringExtraDataRef strings = CreateNiObject<NiStringExtraData>();
			strings->SetName("UPB");
			strings->SetData(T2AString(ostr.str()).c_str());
			root->AddExtraData(DynamicCast<NiExtraData>(strings));
			ok = true;
		}
	}
	return ok;
}
开发者ID:Doommarine23,项目名称:max_nif_plugin,代码行数:30,代码来源:Util.cpp

示例9: ExportNodeHeader

void XsiExp::ExportNodeHeader( INode * node, TCHAR * type, int indentLevel)
{
	TSTR indent = GetIndent(indentLevel);
	
	// node header: object type and name
	fprintf(pStream,"%s%s frm-%s {\n\n", indent.data(), type, FixupName(node->GetName()));
}
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:7,代码来源:export.cpp

示例10: atoi

void DxStdMtl2::PatchInLightNodes()
{
	for(int i = 0; i< sceneLights.Count(); i++)
	{
		int curLightIndex = -1;

		for(int j=0; j<elementContainer.NumberofElementsByType(EffectElements::kEleLight);j++)
		{
			LightElement * le = static_cast<LightElement*>(elementContainer.GetElementByType(j, EffectElements::kEleLight));
			TSTR paramName = le->GetParameterName();

			int actualLength = paramName.first('_');

			for(int k=0; k<actualLength;k++)
			{
				if(isdigit(paramName[k]))
				{
					TSTR numChar = paramName.Substr(k,actualLength-k);
					int index = atoi(numChar.data());
					if(index == i)
					{						
						le->AddLight(sceneLights[i]->GetLightNode());

						break;
					}

				}
			}
		}
	}
}
开发者ID:whztt07,项目名称:OgreGameProject,代码行数:31,代码来源:DxStdMtl2.cpp

示例11: GetTargetPoint

void
SpotLightFalloffManipulator::UpdateShapes(TimeValue t, TSTR& toolTip)
{
    GenLight* pLight = (GenLight*) mhTarget;

    Matrix3 tm;
    tm = mpINode->GetObjectTM(t);

    Point3 pt;
    float dist;
    BOOL b = GetTargetPoint(t, pt);

    if (!b) {
        dist = pLight->GetTDist(t);
    } else {
        float den = FLength(tm.GetRow(2));
        dist = (den!=0) ? FLength(tm.GetTrans()-pt) / den : 0.0f;
    }

    TSTR nodeName;
    nodeName = mpINode->GetName();

    toolTip.printf("%s [Falloff: %5.2f]", nodeName.data(),
                   (double) pLight->GetFallsize(t));

    SetGizmoScale(dist / kRingScaleFactor);

    ConeAngleManipulator::SetValues(Point3(0,0,0),
                                    Point3(0,0,-1),
                                    dist,
                                    DegToRad(pLight->GetFallsize(t)),
                                    pLight->GetSpotShape() == RECT_LIGHT,
                                    pLight->GetAspect(t));
}
开发者ID:2asoft,项目名称:xray,代码行数:34,代码来源:coneanglemanip.cpp

示例12: GetActions

ActionTable* UnwrapClassDesc::GetActions()
{
	TSTR name = GetString(IDS_RB_UNWRAPMOD);
	ActionTable* pTab;
	pTab = new ActionTable(kUnwrapActions, kUnwrapContext, name);        

	int numOps = NumElements(spActions)/3;
	UnwrapAction *wtActions = NULL;
	int ct = 0;
	for (int i =0; i < numOps; i++)
	{
		wtActions = new UnwrapAction();
		int id, ids1, ids2;

		id = spActions[ct++];
		ids1 = spActions[ct++];
		ids2 = spActions[ct++];


		wtActions->Init(id,GetString(ids1),GetString(ids2),
			GetString(IDS_RB_UNWRAPMOD), GetString(IDS_RB_UNWRAPMOD)  );
		pTab->AppendOperation(wtActions);
	}

	GetCOREInterface()->GetActionManager()->RegisterActionContext(kUnwrapContext, name.data());
	return pTab;
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:27,代码来源:Actions.cpp

示例13: proc

int RefCheckDepEnumProc::proc(ReferenceMaker *rmaker) {
	if (rmaker != rtarg)
	{
		TSTR buf;
		FormatObjectDisplay(*count, rmaker, showaddress, buf);
		SendMessage(hWnd, LB_ADDSTRING, 0, (LPARAM)(LPCTSTR)buf.data());
		*count += 1;
	}
	return DEP_ENUM_CONTINUE;
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:10,代码来源:refcheck.cpp

示例14: GetEntryCategory

const MCHAR* HLSLShaderMaterialClassDesc::GetEntryCategory() const
{
	static TSTR s_categoryInfo;
	if( s_categoryInfo.length()==0 ) {
		s_categoryInfo = GetString( IDS_CATEGORY_MPOOL_PREFIX );
		s_categoryInfo += _T("\\");
		s_categoryInfo += GetString( IDS_CATEGORY_MPOOL );
	}
	return s_categoryInfo.data();
}
开发者ID:ZuqiuMao,项目名称:HLSLMaterial,代码行数:10,代码来源:HLSLShaderMaterial.cpp

示例15: initializeList

void CityList::initializeList()
{
	mNumCities = 0;
	delete[] mpCityList;
	mpCityList = NULL;
	delete[] mpCityNames;
	mpCityNames = NULL;
	mCityNameSize = 0;

	Interface* ip = GetCOREInterface();
	TSTR cityFile = ip->GetDir(APP_PLUGCFG_DIR);
	cityFile += "\\sitename.txt";

	// Open the city file.
	FILE* fp = fopen(cityFile.data(), "r");
	if (fp == NULL)
		return;			// No file, return with no cities

	// First count the cities in the file.
	UINT count = 0;
	UINT nameSize = 0;
	{
		Entry temp;
		while (!feof(fp)) {
			UINT namePos = 0;
			if (parseLine(fp, temp, namePos)) {
				++count;
				nameSize += namePos;
			}
		}
	}

	if (count <= 0)
		return;		// No Cities

	mpCityList = new Entry[count];
	mCityNameSize = nameSize;
	mpCityNames = static_cast<TCHAR*>(realloc(mpCityNames, mCityNameSize * sizeof(TCHAR)));
	UINT namePos = 0;

	fseek(fp, 0L, SEEK_SET);
	for (UINT i = 0; i < count && !feof(fp); ) {
		i += parseLine(fp, mpCityList[i], namePos);
	}
	fclose(fp);

	count = i;
	for (i = 0; i < count; ++i)
		mpCityList[i].name = mpCityNames + mpCityList[i].nameOff;

	if (count > 0) {
		qsort(mpCityList, count, sizeof(mpCityList[0]), byname);
		mNumCities = count;
	}
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:55,代码来源:citylist.cpp


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