本文整理汇总了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);
}
示例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;
}
示例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;
}
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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));
}
}
}
}
}
}
示例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;
}
示例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()));
}
示例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;
}
}
}
}
}
}
示例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));
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
}