示例#1
0
// WriteSolutionConfigs
//------------------------------------------------------------------------------
void SLNGenerator::WriteSolutionFolderListings( const Array< SLNSolutionFolder > & folders,
        Array< AString > & solutionFolderPaths )
{
    // Create every intermediate path
    const SLNSolutionFolder * const foldersEnd = folders.End();
    for( const SLNSolutionFolder * it = folders.Begin() ; it != foldersEnd ; ++it )
    {
        if ( solutionFolderPaths.Find( it->m_Path ) == nullptr )
        {
            solutionFolderPaths.Append( it->m_Path );
        }

        const char * pathEnd = it->m_Path.Find( NATIVE_SLASH );
        while ( pathEnd )
        {
            AStackString<> solutionFolderPath( it->m_Path.Get(), pathEnd );
            if ( solutionFolderPaths.Find( solutionFolderPath ) == nullptr )
            {
                solutionFolderPaths.Append( solutionFolderPath );
            }

            pathEnd = it->m_Path.Find( NATIVE_SLASH, pathEnd + 1 );
        }
    }

    solutionFolderPaths.Sort();

    // Solution Folders Listings

    const AString * const solutionFolderPathsEnd = solutionFolderPaths.End();
    for( const AString * it = solutionFolderPaths.Begin() ; it != solutionFolderPathsEnd ; ++it )
    {
        // parse solution folder name
        const char * solutionFolderName = it->FindLast( NATIVE_SLASH );
        solutionFolderName = solutionFolderName ? solutionFolderName + 1 : it->Get();

        // generate a guid for the solution folder
        AStackString<> solutionFolderGuid;
        VSProjectGenerator::FormatDeterministicProjectGUID( solutionFolderGuid, *it );

        // Guid must be uppercase (like visual)
        solutionFolderGuid.ToUpper();

        Write( "Project(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"%s\", \"%s\", \"%s\"\r\n",
               solutionFolderName, solutionFolderName, solutionFolderGuid.Get() );

        Write( "EndProject\r\n" );
    }
}
示例#2
0
Array<String> Class_obj::GetInstanceFields()
{
   Array<String> result = mSuper ? (*mSuper)->GetInstanceFields() : Array<String>(0,0);
   if (mMembers.mPtr)
      for(int m=0;m<mMembers->size();m++)
      {
         const String &mem = mMembers[m];
         if (result->Find(mem)==-1)
            result.Add(mem);
      }
   return result;
}
示例#3
0
int main()
{
    STUDENT student, student1, student2;
    STUDENT* students = new STUDENT[3];

    const char cFirstName[LEN_NAME] = "Vasya        ";
    const char cFirstName1[LEN_NAME] = "Petya        ";
    const char cFirstName2[LEN_NAME]= "Leshaa        ";
    strcpy (student.FirstName, cFirstName);
    strcpy (student1.FirstName, cFirstName1);
    strcpy (student2.FirstName, cFirstName2);

    students[0] = student;
    students[1] = student1;
    students[2] = student2;
    Array a (students, 3);
    //delete[] students;

    //size_t nQnt = a.GetQuantity();
    //students = new STUDENT[nQnt];
    //students = a.GetStudents();

    for (size_t i = 0 ; i < 3; i++){
        cout << students[i].FirstName<< endl;
    }
    for (size_t i = 0; i <5 ; i++){
        cout << "ADD#"<< i <<".0"<<endl;
        a.Add (students[0]);
        cout << "ADD#"<< i <<".1"<<endl;
        a.Add (students[0]);
        cout << "ADD#"<< i <<".2"<<endl;
        a.Add (students[0]);
    }   
       delete[] students;

    STUDENT** rStud = a.GetStudents();
    size_t nQnt = a.GetQuantity();
    cout << "Quantity is "<< nQnt<<endl;
    for (size_t i = 0 ; i < nQnt; i++){
        cout << i << ". "<< rStud[i]->FirstName<< endl;
    }




    STUDENT editStudent;
    const char cFirstNameEdit[LEN_NAME]= "Edit        ";
    strcpy (editStudent.FirstName, cFirstNameEdit);
    a.Edit (editStudent, 16);
    cout<<"MAIN EDIT "<<endl;
    a.Show ();

    bool* arr = new bool[a.GetQuantity ()];
    a.Find( "Vasya", COL_FIRST_NAME , arr );
    cout<<"FIND "<<endl;
    for (size_t i = 0; i < a.GetQuantity (); i++){
        cout << i<<". "<< (bool)arr[i]<<endl;
    }
    delete[] arr;

    a.DeleteStudent (14);
    cout<<"DELETE  "<<endl;
    //a.Show ();
    cout << "Hello World!" << endl;


    return 0;
}