"justify"> # include Item.h
# include lt; iostream gt;
# include lt; iomanip gt; namespace std; :: Item (void)
{
} :: Item (Item amp; i)
{_s(id,i.id);_s(kategory,i.kategory);_s(name,i.name);_s(descr,i.descr);_s(proizv,i.proizv);=i.price;
} :: ~ Item (void)
{
} Item :: SetID (char * idd)
{_ s (id, idd);
} * Item :: GetID ()
{id;
} Item :: SetKategory (char * k)
{_ s (kategory, k);
} * Item :: GetKategory ()
{kategory;
} Item :: SetName (char * nm)
{_ s (name, nm);
} * Item :: GetName ()
{name;
} Item :: SetDescr (char * dsc)
{_ s (descr, dsc);
} * Item :: GetDescr ()
{descr;
} Item :: SetProizv (char * pr)
{_ s (proizv, pr);
} * Item :: GetProizv ()
{proizv;
} Item :: SetPrice (char * pr)
{= atoi (pr);
} Item :: GetPrice ()
{price;
} Item :: PrintBlock ()
{lt;lt;setfill(laquo;-raquo;)lt;lt;setw(44)lt;lt;laquo;nraquo;;lt;lt;setfill(laquo; ); lt; lt; ВД номер: lt; lt; setw (30) lt; lt; GetID () lt; lt; endl; lt; lt; Категорія: raquo;lt;lt;setw(30)lt;lt;GetKategory()lt;lt;endl;lt;lt;laquo;Наименование:raquo;lt;lt;setw(30)lt;lt;GetName()lt;lt;endl;
//coutlt;lt;cout.widen(30)lt;lt;GetDescr()lt;lt;endl;lt;lt;laquo;Описание: raquo;lt;lt;endl;(42,GetDescr());lt;lt;laquo;Производительraquo;lt;lt;setw(30)lt;lt;GetProizv()lt;lt;endl;lt;lt;laquo;Стоимость raquo;lt;lt;setw(30)lt;lt;GetPrice()lt;lt;endl;lt;lt;setfill(laquo;-raquo;)lt;lt;setw(44)lt;lt;laquo;nraquo;;lt;lt;setfill(laquo; );
} Item :: SetSimbolsInLine (int a, char * b)
{d=0, h=0; (int i=0; i lt; 256; i ++)
{++; (b [i]!= ю amp; amp; b [i + 1]!= ю )
{ lt; lt; b [i]; (d gt; a)
{= 0; lt; lt; setw (30) lt; lt; n raquo ;;
}
}
} lt; lt; n raquo ;;
}
Клас IOCore
#pragma once
#include lt; string.h gt;
#include lt; iostream gt;
#include lt; fstream gt; namespace std; IOCore
{FReader, FWriter; * path; blockSize; blockCount; :( void); (char * filename);
~ IOCore (void); openFile (); closeFile (); GetBlockSize (int); incBlockCount (); SetPath (char *); * GetPath();CheckBlockCount();SetBlockCount(int);GetBlockCount();BlockCount();ReadBlock(char*,char*,char*,char*,char*,char*);
};
#include stdafx.h
#include IOCore.h
#include lt; iostream gt;
#include lt; fstream gt; :: IOCore (void)
{= 6;
} :: IOCore (char * filename)
{. open (filename); (! FReader) {cout lt; lt; файл не виявлений ... raquo ;;} {cout lt; lt; файл знайдений ... lt; lt; endl ;}
} :: ~ IOCore (void)
{:: cout lt; lt; destroyed lt; lt; endl;
} IOCore :: openFile ()
{(path!= )
{. open (path); (! FReader)
{ lt; lt; файл не виявлений ... raquo ;;
}
{ lt; lt; файл знайдений ... lt; lt; endl;
}
}
{:: cout lt; lt; параметр path не вказано lt; lt; endl;
}
} IOCore :: closeFile ()
{. close ();
} IOCore :: SetPath (char * s)
{= s;
} IOCore :: GetBlockSize (int size)
{(size gt; 0)
{= size;
}
{:: cout lt; lt; Error :: BlockSize lt; 0 :: lt; lt; endl;
}
} IOCore :: CheckBlockCount ()
{= 0; char g [256]; (! FReader.eof ())
{++ ;. getline (g, 256);
}=blockCount/blockSize; lt; lt; blockCount= lt; lt; blockCount lt; lt; endl; .seekg (0);
} IOCore :: BlockCount ()
{blockCount;
} IOCore :: incBlockCount ()
{+=1;
} IOCore :: SetBlockCount (int a)
{= a;
} IOCore :: GetBlockCount ()
{blockCount;
} IOCore :: ReadBlock (char * first, char * second, char * theerd, char * fourth, char * five, char * six)
{.getline(first,20);.getline(second,256);.getline(theerd,256);.getline(fourth,256);.getline(five,256);.getline(six,256);
}
Головна функція
//АРМ_менедж...