本文整理汇总了C++中AcStringArray::length方法的典型用法代码示例。如果您正苦于以下问题:C++ AcStringArray::length方法的具体用法?C++ AcStringArray::length怎么用?C++ AcStringArray::length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcStringArray
的用法示例。
在下文中一共展示了AcStringArray::length方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExcludePath
static CString ExcludePath( const CString& supportPath, const CString& arxPath )
{
AcStringArray cc;
SplitCString( supportPath, _T( ";" ), cc );
AcStringArray paths;
int n = cc.length();
for( int i = 0; i < n; i++ )
{
if( cc[i].compareNoCase( arxPath ) == 0 ) continue;
paths.append( cc[i] );
}
CString path;
n = paths.length();
for( int i = 0; i < n; i++ )
{
if( i == n - 1 )
{
path.AppendFormat( _T( "%s" ), paths[i].kACharPtr() );
}
else
{
path.AppendFormat( _T( "%s;" ), paths[i].kACharPtr() );
}
}
return path;
}
示例2: GetIntStrList
bool IntStrListHelper::GetIntStrList( const CString& name, AcDbIntArray& intList, AcStringArray& strList )
{
AcStringArray entries;
if( !ArxDictHelper::GetAllEntries( INT_LIST_DICT, name, entries ) ) return false;
int len = entries.length();
bool ret = ( len > 0 && len % 2 == 0 );
if( ret ) // 长度必须为偶数
{
intList.removeAll();
strList.removeAll();
for( int i = 0; i < len; i++ )
{
if( i % 2 == 0 ) // 偶数位置的元素为整数
{
intList.append( _ttoi( entries[i].kACharPtr() ) );
}
else // 奇数位置的元素为字符串
{
strList.append( entries[i] );
}
}
}
return ret;
}
示例3: SetObjectDatas
bool ReportDataHelper::SetObjectDatas( const AcDbObjectId& objId,const AcStringArray& values )
{
if( objId.isNull() ) return false;
AcTransaction* pTrans = actrTransactionManager->startTransaction();
if( pTrans == 0 ) return false;
AcDbObject* pObj;
if( Acad::eOk != pTrans->getObject( pObj, objId, AcDb::kForWrite ) )
{
actrTransactionManager->abortTransaction();
return false;
}
DataObject* pDO = DataObject::cast( pObj );
if( pDO == 0 )
{
actrTransactionManager->abortTransaction();
return false;
}
pDO->clearAll();
for(int i = 0; i < values.length(); i++)
{
CString value = values[i].kACharPtr();
pDO->addData();
pDO->setData(i,value);
}
actrTransactionManager->endTransaction();
return true;
}
示例4: fillVarList
void FieldInfoDlg::fillVarList()
{
m_varList.ResetContent(); // 清空列表
AcStringArray names;
switch( m_lt )
{
case LT_STRING:
StringListHelper::GetAllNames( names );
break;
case LT_INT:
IntStrListHelper::GetAllNames( names );
break;
case LT_OBJECT:
DataObjectListHelper::GetAllNames( names );
break;
}
if( names.isEmpty() ) return;
int index = names.find( m_varName );
if( index < 0 ) m_varName = _T( "" ); // 清空
int len = names.length();
for( int i = 0; i < len; i++ )
{
m_varList.AddString( names[i].kACharPtr() );
}
m_varList.SetCurSel( index );
}
示例5: explodeBlock
void BlockDraw::explodeBlock( AcGeVoidPointerArray& ents )
{
// 填充属性数据
AcStringArray names;
regPropertyDataNames( names );
if( names.isEmpty() )
{
acutPrintf( _T( "\n没有注册要提取的字段..." ) );
return;
}
if( names.length() != m_attValues.length() )
{
acutPrintf( _T( "\n注册的属性数据与读取的数据个数不相等!" ) );
return;
}
AcDbObjectId blkId = GetBlockDefinitionByName( m_blockName );
if( blkId.isNull() )
{
acutPrintf( _T( "\n未知的块定义:%s" ), m_blockName );
return;
}
// 计算变换矩阵
AcGeMatrix3d blkXform = GetBlockTransformMatrix( blkId, m_insertPt, m_angle, m_scale );
// 分解块定义
BlockToEntity( blkId, blkXform, names, m_attValues, ents );
}
示例6: ReadDatas
void ReportDataHelper::ReadDatas( const CString& name, ArrayVector& datasVector,int unitCount )
{
AcStringArray getDatas;
AcDbObjectId objId;
GDESDataObjectHelper::GetObjectId(name,objId);
GetObjectDatas(objId,getDatas);
//AcStringArray strName,strIsRunning,strReason;
ArrayVector datas;
int nCount = getDatas.length();
if(nCount <= 0) return;
datas.resize( unitCount );
for(int i = 0; i < nCount; i = i+2 )
{
int j = (i/2)% unitCount;
datas[j].append(getDatas[i]);
}
datasVector.clear();
for(int i = 0; i < nCount / (2 * unitCount); i++)
{
CString temp;
AcStringArray temps;
for(int j = 0; j < unitCount; j++)
{
temp.Format(_T("%s"),datas[j][i].kACharPtr());
if(temp == ISNULL) temp = _T("");
temps.append(temp);
}
datasVector.push_back(temps);
}
}
示例7: BuildPropGridCtrl
bool PropertyDataUpdater::BuildPropGridCtrl( CMFCPropertyGridCtrl* pPropDataList, const CString& type, const AcStringArray& fields )
{
if( pPropDataList == NULL ) return false;
if( type.GetLength() == 0 ) return false;
if( fields.isEmpty() ) return false;
// 清空已添加的属性
pPropDataList->RemoveAll();
//acutPrintf(_T("\n清空所有属性..."));
// 创建MFCPropertyGridCtrlHelper对象
// 同时初始化m_propertyDataList的属性
// 参见MFCPropertyGridCtrlHelper的构造函数
MFCPropertyGridCtrlHelper pgch( pPropDataList );
int len = fields.length();
for( int i = 0; i < len; i++ )
{
CString name = fields[i].kACharPtr();
FieldInfo info; // 默认设置(DT_STRING, m_enable=true, m_descr =_T(""))
FieldInfoHelper::ReadFieldInfo( type, name, info );
// 构建PropertyList
BuildPropList( pgch, name, _T( "" ), info ); // 赋予空字符串
}
//PrintPropList(pPropDataList);
return true;
}
示例8: StringsToNum
static void StringsToNum( const AcStringArray& strDatas, doubleVector& doubleDatas)
{
for(int i = 0; i < strDatas.length(); i++)
{
double temp = _tstof(strDatas[i].kACharPtr());
doubleDatas.push_back(temp);
}
}
示例9: CreatDrillTables
static void CreatDrillTables(const CString& type, const AcStringArray& funcs,const AcDbObjectId& objId)
{
for (int j =0 ; j < funcs.length(); j++)
{
MyWord->WriteText(funcs[j].kACharPtr(),wdAlignParagraphJustify);
MyWord->TypeParagraph();
CreatDrillTable(type,funcs[j].kACharPtr(),objId);
MyWord->MoveToEnd();
MyWord->TypeParagraph();
}
}
示例10: RemoveAllFields
void FieldHelper::RemoveAllFields( const CString& type )
{
AcStringArray fields;
GetAllFields( type, fields );
int len = fields.length();
for( int i = 0; i < len; i++ )
{
RemoveField( type, fields[i].kACharPtr() );
}
RemoveKey_Helper( PROPERTY_DATA_FIELD_DICT, type );
}
示例11: FillLayerList
void ContourLayerDlg::FillLayerList()
{
// 读取所有图层列表
AcStringArray layers;
GetEntityLayers( _T( "ContourGE" ), layers );
m_layerList.ResetContent();
// 填充列表
int n = layers.length();
for( int i = 0; i < n; i++ )
{
m_layerList.AddString( layers[i].kACharPtr() );
}
}
示例12: RemoveAllObject
bool DataObjectListHelper::RemoveAllObject( const CString& name )
{
if( name.GetLength() == 0 ) return false;
AcStringArray values;
GetObjectNameList( name, values );
bool ret = true;
int len = values.length();
for( int i = 0; i < len; i++ )
{
ret = ( ret && RemoveObject( name, values[i].kACharPtr() ) );
}
ArxDictHelper::RemoveAllEntries( OBJECT_LIST_DICT, name );
return ret;
}
示例13: GetFieldsDatas
static bool GetFieldsDatas(const CString& type, const CString& func, const AcDbObjectId& objId,AcStringArray& fields,AcStringArray& datas)
{
fields.removeAll();
datas.removeAll();
if(!FuncFieldHelper::GetFields(func,type,fields)) return false;
fields.remove(_T("钻孔名称"));
for(int i = 0; i < fields.length(); i++)
{
CString strData;
if(!DataHelper::GetPropertyData(objId,fields[i].kACharPtr(),strData)) return false;
DealIntListDatas(fields[i].kACharPtr(),strData);
datas.append(strData);
}
return true;
}
示例14: AddStringList
bool StringListHelper::AddStringList( const CString& name, const AcStringArray& strList )
{
if( ( name.GetLength() == 0 ) || strList.isEmpty() ) return false;
ArxDictTool* pDictTool = ArxDictTool::GetDictTool( STRING_LIST_DICT );
bool ret = pDictTool->findKey( name );
if( !ret ) // 如果变量name已存在,则不进行修改
{
int len = strList.length();
for( int i = 0; i < len; i++ )
{
pDictTool->addEntry( name, strList[i].kACharPtr() );
}
}
delete pDictTool;
return !ret;
}
示例15: IsPathExit
static bool IsPathExit( const CString& supportPath, const CString& arxPath )
{
AcStringArray cc;
SplitCString( supportPath, _T( ";" ), cc );
bool bFind = false;
int n = cc.length();
for( int i = 0; i < n; i++ )
{
if( cc[i].compareNoCase( arxPath ) == 0 )
{
bFind = true;
break;
}
}
return bFind;
}