niedziela, 24 września 2017

Collection of ASCII (class in Visual C++)

class collection_of_ASCII
{
private:
System::Char set_Ascii[256];
public: 
collection_of_ASCII();
System::Boolean is_in_Colection(System::Char value);
collection_of_ASCII& Connect(collection_of_ASCII temp_Collection);
collection_of_ASCII& operator -(System::Char value);
collection_of_ASCII& operator +(System::Char value);
};

collection_of_ASCII::collection_of_ASCII()
{
System::Int64 i;
for(i=0;i<256;i++)
set_Ascii[i]=0;
}
System::Boolean collection_of_ASCII::is_in_Colection(System::Char value)
{
if(set_Ascii[value]==-1)
return true;
else
return false;
}
collection_of_ASCII& collection_of_ASCII::Connect(collection_of_ASCII temp_Collection)
{
System::Int64 i;
for(i=0;i<256;i++)
if(temp_Collection.is_in_Colection(i))
set_Ascii[i]=-1;
return *this;
}
collection_of_ASCII& collection_of_ASCII::operator -(System::Char value)
{
 set_Ascii[value]=0;
 return *this;
}
collection_of_ASCII& collection_of_ASCII::operator +(System::Char value)
{
set_Ascii[value]=-1;
return *this;
}

Brak komentarzy:

Prześlij komentarz