コード例 #1
0
ファイル: utility.cpp プロジェクト: salilab/imp
void read_files(Model *m, const std::vector<std::string>& files,
                std::vector<std::string>& pdb_file_names,
                std::vector<std::string>& dat_files,
                std::vector<IMP::Particles>& particles_vec,
                Profiles& exp_profiles, bool residue_level,
                bool heavy_atoms_only, int multi_model_pdb,
                bool explicit_water, float max_q, int units) {

  for (unsigned int i = 0; i < files.size(); i++) {
    // check if file exists
    std::ifstream in_file(files[i].c_str());
    if (!in_file) {
      IMP_WARN("Can't open file " << files[i] << std::endl);
      return;
    }
    // 1. try as pdb
    try {
      read_pdb(m, files[i], pdb_file_names, particles_vec, residue_level,
               heavy_atoms_only, multi_model_pdb, explicit_water);
    }
    catch (const IMP::ValueException &e) {  // not a pdb file
      // 2. try as a dat profile file
      IMP_NEW(Profile, profile, (files[i], false, max_q, units));
      if (profile->size() == 0) {
        IMP_WARN("can't parse input file " << files[i] << std::endl);
        return;
      } else {
        dat_files.push_back(files[i]);
        exp_profiles.push_back(profile);
        IMP_LOG_TERSE("Profile read from file " << files[i]
                      << " size = " << profile->size() << std::endl);
      }
    }
  }
}
コード例 #2
0
ProfileLoader::Profiles ProfileLoader::getAudioProfiles() const
{
	Profiles profiles;

	for( Profiles::const_iterator it = _profiles.begin(); it != _profiles.end(); ++it )
	{
		if( (*it).find( constants::avProfileType )->second == constants::avProfileTypeAudio )
			profiles.push_back( *it );
	}

	return profiles;
}
コード例 #3
0
ファイル: OLAddrBook.cpp プロジェクト: hackshields/antivirus
	void COLAddrBook::GetProfiles(Profiles& profiles)
	{
		profiles.clear();

		LPPROFADMIN pProfAdmin = NULL;
		if (SUCCEEDED(g_pMAPIEDK->pMAPIAdminProfiles(0, &pProfAdmin)))
		{
			LPMAPITABLE pProfTable = NULL;
			if (SUCCEEDED(pProfAdmin->GetProfileTable(0, &pProfTable)))
			{
				SizedSPropTagArray ( 2, sptCols ) = {2, PR_DISPLAY_NAME, PR_DEFAULT_PROFILE};
				LPSRowSet pRowSet = NULL;

				if (SUCCEEDED(g_pMAPIEDK->pHrQueryAllRows(pProfTable, reinterpret_cast<SPropTagArray*>(&sptCols), NULL, NULL, 0, &pRowSet)))
				{
					for (ULONG i = 0; i < pRowSet->cRows; ++i)
					{
						bool bDefaultProfile = false;
						if (LPSPropValue pPVN = g_pMAPIEDK->pPpropFindProp(pRowSet->aRow[i].lpProps, pRowSet->aRow[i].cValues, PR_DEFAULT_PROFILE))
						{
							bDefaultProfile = pPVN->Value.b != 0;
						}

						if (LPSPropValue pPVN = g_pMAPIEDK->pPpropFindProp(pRowSet->aRow[i].lpProps, pRowSet->aRow[i].cValues, PR_DISPLAY_NAME))
						{
							profiles.push_back(std::make_pair(pPVN->Value.lpszA ? pPVN->Value.lpszA : "", bDefaultProfile));
						}
					}

					g_pMAPIEDK->pFreeProws(pRowSet);
				}
			}
			
			if (pProfTable)
				pProfTable->Release();
		}

		if (pProfAdmin)
			pProfAdmin->Release();

	}