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


C++ PrintAttribute函数代码示例

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


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

示例1: PrintNode

/**
 * Print a node, its attributes, and all its children recursively.
 */
void PrintNode(FbxNode* pNode) {
    PrintTabs();
    const char* nodeName = pNode->GetName();
    FbxDouble3 translation = pNode->LclTranslation.Get(); 
    FbxDouble3 rotation = pNode->LclRotation.Get(); 
    FbxDouble3 scaling = pNode->LclScaling.Get();

    // Print the contents of the node.
    printf("<node name='%s' translation='(%f, %f, %f)' rotation='(%f, %f, %f)' scaling='(%f, %f, %f)'>\n", 
        nodeName, 
        translation[0], translation[1], translation[2],
        rotation[0], rotation[1], rotation[2],
        scaling[0], scaling[1], scaling[2]
        );
    numTabs++;

    // Print the node's attributes.
    for(int i = 0; i < pNode->GetNodeAttributeCount(); i++)
        PrintAttribute(pNode->GetNodeAttributeByIndex(i));

    // Recursively print the children.
    for(int j = 0; j < pNode->GetChildCount(); j++)
        PrintNode(pNode->GetChild(j));

    numTabs--;
    PrintTabs();
    printf("</node>\n");
}
开发者ID:cwarwick3,项目名称:personalProject,代码行数:31,代码来源:FbxImporting.cpp

示例2: PrintTabs

/**
* Print a node, its attributes, and all its children recursively.
*/
void FBXSceneImporter::PrintNode(FbxNode* pNode)
{
	PrintTabs();
	const char* nodeName = pNode->GetName();
	FbxDouble3 translation = pNode->LclTranslation.Get();
	FbxDouble3 rotation = pNode->LclRotation.Get();
	FbxDouble3 scaling = pNode->LclScaling.Get();

	// Print the contents of the node.
	myfile << "<node name= " << nodeName << "\n";

	numTabs++;

	// Print the node's attributes.
	for (int i = 0; i < pNode->GetNodeAttributeCount(); i++)
		PrintAttribute(pNode->GetNodeAttributeByIndex(i));


	// Recursively print the children.
	for (int j = 0; j < pNode->GetChildCount(); j++)
		PrintNode(pNode->GetChild(j));

	numTabs--;
	PrintTabs();
	myfile << "</node>\n" ;
}
开发者ID:Muret,项目名称:Zephyr,代码行数:29,代码来源:FBXSceneImporter.cpp

示例3: ParseInteger

void ARMAttributeParser::FP_HP_extension(AttrType Tag, const uint8_t *Data,
                                         uint32_t &Offset) {
  static const char *const Strings[] = { "If Available", "Permitted" };

  uint64_t Value = ParseInteger(Data, Offset);
  StringRef ValueDesc =
    (Value < array_lengthof(Strings)) ? Strings[Value] : nullptr;
  PrintAttribute(Tag, Value, ValueDesc);
}
开发者ID:dberlin,项目名称:llvm-gvn-rewrite,代码行数:9,代码来源:ARMAttributeParser.cpp

示例4: ParseInteger

void ARMAttributeParser::ABI_PCS_R9_use(AttrType Tag, const uint8_t *Data,
                                        uint32_t &Offset) {
  static const char *Strings[] = { "v6", "Static Base", "TLS", "Unused" };

  uint64_t Value = ParseInteger(Data, Offset);
  StringRef ValueDesc =
    (Value < array_lengthof(Strings)) ? Strings[Value] : nullptr;
  PrintAttribute(Tag, Value, ValueDesc);
}
开发者ID:0xDEC0DE8,项目名称:mcsema,代码行数:9,代码来源:ARMAttributeParser.cpp

示例5: PrintNode

 //-----------------------------------------------------------------------------------
 static void PrintNode(FbxNode* node, int depth)
 {
     Console::instance->PrintLine(Stringf("%*sNode [%s]\n", depth, " ", node->GetName()));
     DebuggerPrintf("%*sNode [%s]\n", depth, " ", node->GetName());
     for (int i = 0; i < node->GetNodeAttributeCount(); ++i)
     {
         PrintAttribute(node->GetNodeAttributeByIndex(i), depth);
     }
     for (int i = 0; i < node->GetChildCount(); ++i)
     {
         PrintNode(node->GetChild(i), depth + 1);
     }
 }
开发者ID:picoriley,项目名称:CloudyCraft,代码行数:14,代码来源:fbx.cpp

示例6: PrintJournalInfoBlock

void PrintJournalInfoBlock(out_ctx* ctx, const JournalInfoBlock* record)
{
    /*
       struct JournalInfoBlock {
         uint32_t       flags;
         uint32_t       device_signature[8];  // signature used to locate our device.
         uint64_t       offset;               // byte offset to the journal on the device
         uint64_t       size;                 // size in bytes of the journal
         uuid_string_t   ext_jnl_uuid;
         char            machine_serial_num[48];
         char     reserved[JIB_RESERVED_SIZE];
       } __attribute__((aligned(2), packed));
       typedef struct JournalInfoBlock JournalInfoBlock;
     */

    BeginSection(ctx, "Journal Info Block");
    PrintRawAttribute(ctx, record, flags, 2);
    PrintUIFlagIfMatch(ctx, record->flags, kJIJournalInFSMask);
    PrintUIFlagIfMatch(ctx, record->flags, kJIJournalOnOtherDeviceMask);
    PrintUIFlagIfMatch(ctx, record->flags, kJIJournalNeedInitMask);
    _PrintRawAttribute(ctx, "device_signature", &record->device_signature[0], 32, 16);
    PrintDataLength(ctx, record, offset);
    PrintDataLength(ctx, record, size);

    char uuid_str[sizeof(uuid_string_t) + 1];
    (void)strlcpy(uuid_str, &record->ext_jnl_uuid[0], sizeof(uuid_str));
    PrintAttribute(ctx, "ext_jnl_uuid", uuid_str);

    char serial[49];
    (void)strlcpy(serial, &record->machine_serial_num[0], 49);
    PrintAttribute(ctx, "machine_serial_num", serial);

    // (uint32_t) reserved[32]

    EndSection(ctx);
}
开发者ID:ahknight,项目名称:hfsinspect,代码行数:36,代码来源:journal.c

示例7: CommandAttrib


//.........这里部分代码省略.........
					break;

				case _T('H'):
					dwMask   |= FILE_ATTRIBUTE_HIDDEN;
					dwAttrib |= FILE_ATTRIBUTE_HIDDEN;
					break;

				case _T('R'):
					dwMask   |= FILE_ATTRIBUTE_READONLY;
					dwAttrib |= FILE_ATTRIBUTE_READONLY;
					break;

				case _T('S'):
					dwMask   |= FILE_ATTRIBUTE_SYSTEM;
					dwAttrib |= FILE_ATTRIBUTE_SYSTEM;
					break;

				default:
					error_invalid_parameter_format (arg[i]);
					freep (arg);
					return -1;
			}
		}
		else if (*arg[i] == _T('-'))
		{
			if (_tcslen (arg[i]) != 2)
			{
				error_invalid_parameter_format (arg[i]);
				freep (arg);
				return -1;
			}

			switch ((TCHAR)_totupper (arg[i][1]))
			{
				case _T('A'):
					dwMask   |= FILE_ATTRIBUTE_ARCHIVE;
					dwAttrib &= ~FILE_ATTRIBUTE_ARCHIVE;
					break;

				case _T('H'):
					dwMask   |= FILE_ATTRIBUTE_HIDDEN;
					dwAttrib &= ~FILE_ATTRIBUTE_HIDDEN;
					break;

				case _T('R'):
					dwMask   |= FILE_ATTRIBUTE_READONLY;
					dwAttrib &= ~FILE_ATTRIBUTE_READONLY;
					break;

				case _T('S'):
					dwMask   |= FILE_ATTRIBUTE_SYSTEM;
					dwAttrib &= ~FILE_ATTRIBUTE_SYSTEM;
					break;

				default:
					error_invalid_parameter_format (arg[i]);
					freep (arg);
					return -1;
			}
		}
	}

	if (argc == 0)
	{
		DWORD len;

		len = GetCurrentDirectory (MAX_PATH, szPath);
		if (szPath[len-1] != _T('\\'))
		{
			szPath[len] = _T('\\');
			szPath[len + 1] = 0;
		}
		_tcscpy (szFileName, _T("*.*"));
		PrintAttribute (szPath, szFileName, bRecurse);
		freep (arg);
		return 0;
	}

	/* get full file name */
	for (i = 0; i < argc; i++)
	{
		if ((*arg[i] != _T('+')) && (*arg[i] != _T('-')) && (*arg[i] != _T('/')))
		{
			LPTSTR p;
			GetFullPathName (arg[i], MAX_PATH, szPath, NULL);
			p = _tcsrchr (szPath, _T('\\')) + 1;
			_tcscpy (szFileName, p);
			*p = _T('\0');

			if (dwMask == 0)
				PrintAttribute (szPath, szFileName, bRecurse);
			else
				ChangeAttribute (szPath, szFileName, dwMask,
						 dwAttrib, bRecurse, bDirectories);
		}
	}

	freep (arg);
	return 0;
}
开发者ID:RareHare,项目名称:reactos,代码行数:101,代码来源:attrib.c

示例8: EnterConsole


//.........这里部分代码省略.........
                    hlItemGetPath(pSubItem, lpTempBuffer, sizeof(lpTempBuffer));

                    printf("Information for %s:\n", lpTempBuffer);
                    printf("\n");

                    switch(hlItemGetType(pSubItem))
                    {
                    case HL_ITEM_FOLDER:
                        printf("  Type: Folder\n");
#ifdef _WIN32
                        printf("  Size: %I64u B\n", hlFolderGetSizeEx(pSubItem, hlTrue));
                        printf("  Size On Disk: %I64u B\n", hlFolderGetSizeOnDiskEx(pSubItem, hlTrue));
#else
                        printf("  Size: %llu B\n", hlFolderGetSizeEx(pSubItem, hlTrue));
                        printf("  Size On Disk: %llu B\n", hlFolderGetSizeOnDiskEx(pSubItem, hlTrue));
#endif
                        printf("  Folders: %u\n", hlFolderGetFolderCount(pSubItem, hlTrue));
                        printf("  Files: %u\n", hlFolderGetFileCount(pSubItem, hlTrue));
                        break;
                    case HL_ITEM_FILE:
                        printf("  Type: File\n");
                        printf("  Extractable: %s\n", hlFileGetExtractable(pSubItem) ? "True" : "False");
                        //printf("  Validates: %s\n", hlFileGetValidates(pSubItem) ? "True" : "False");
                        printf("  Size: %u B\n", hlFileGetSize(pSubItem));
                        printf("  Size On Disk: %u B\n", hlFileGetSizeOnDisk(pSubItem));
                        break;
                    }

                    uiItemCount = hlPackageGetItemAttributeCount();
                    for(i = 0; i < uiItemCount; i++)
                    {
                        if(hlPackageGetItemAttribute(pSubItem, i, &Attribute))
                        {
                            PrintAttribute("  ", &Attribute, "");
                        }
                    }

                    printf("\n");
                }
                else
                {
                    printf("%s not found.\n", lpArgument);
                }
            }
        }
        //
        // Extract item.
        // Good example of CPackageUtility extract functions.
        //
        else if(stricmp(lpCommand, "extract") == 0)
        {
            if(*lpArgument == 0)
            {
                printf("No argument for command extract supplied.\n");
            }
            else
            {
                if(stricmp(lpArgument, ".") == 0)
                {
                    pSubItem = pItem;
                }
                else
                {
                    pSubItem = hlFolderGetItemByName(pItem, lpArgument, HL_FIND_ALL);
                }
开发者ID:Rupan,项目名称:HLLib,代码行数:66,代码来源:Main.c

示例9: PrintAttribute

static VOID
PrintAttribute (LPTSTR pszPath, LPTSTR pszFile, BOOL bRecurse)
{
	WIN32_FIND_DATA findData;
	HANDLE hFind;
	TCHAR  szFullName[MAX_PATH];
	LPTSTR pszFileName;

	/* prepare full file name buffer */
	_tcscpy (szFullName, pszPath);
	pszFileName = szFullName + _tcslen (szFullName);

	/* display all subdirectories */
	if (bRecurse)
	{
		/* append file name */
		_tcscpy (pszFileName, pszFile);

		hFind = FindFirstFile (szFullName, &findData);
		if (hFind == INVALID_HANDLE_VALUE)
		{
			ErrorMessage (GetLastError (), pszFile);
			return;
		}

		do
		{
			if (!(findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
				continue;

			if (!_tcscmp (findData.cFileName, _T(".")) ||
				!_tcscmp (findData.cFileName, _T("..")))
				continue;

			_tcscpy (pszFileName, findData.cFileName);
			_tcscat (pszFileName, _T("\\"));
			PrintAttribute (szFullName, pszFile, bRecurse);
		}
		while (FindNextFile (hFind, &findData));
		FindClose (hFind);
	}

	/* append file name */
	_tcscpy (pszFileName, pszFile);

	/* display current directory */
	hFind = FindFirstFile (szFullName, &findData);
	if (hFind == INVALID_HANDLE_VALUE)
	{
		ErrorMessage (GetLastError (), pszFile);
		return;
	}

	do
	{
		if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
			continue;

		_tcscpy (pszFileName, findData.cFileName);

		ConOutPrintf (_T("%c  %c%c%c     %s\n"),
		              (findData.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE) ? _T('A') : _T(' '),
		              (findData.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM) ? _T('S') : _T(' '),
		              (findData.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) ? _T('H') : _T(' '),
		              (findData.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? _T('R') : _T(' '),
		              szFullName);
	}
	while (FindNextFile (hFind, &findData));
	FindClose (hFind);
}
开发者ID:RareHare,项目名称:reactos,代码行数:70,代码来源:attrib.c


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