12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268 |
- //////////////////////////////////////////////////////////////////////////////
- //
- // Copyright 2015 Autodesk, Inc. All rights reserved.
- //
- // Use of this software is subject to the terms of the Autodesk license
- // agreement provided at the time of installation or download, or which
- // otherwise accompanies this software in either electronic or hard copy form.
- //
- //////////////////////////////////////////////////////////////////////////////
- // Name: asisdata.h ast_asi_inc_appl_asisdata_h
- //
- // Description: Basic SQL data definitions for ASI.
- // ASI C++ User Interface.
- #ifndef ASI_SDATA_HH
- #define ASI_SDATA_HH asisdata.hh
- #define AST_DEPRECATE_TEXT "This function is deprecated. Consider using another overload of this function."
- #define AST_DEPRECATE __declspec(deprecated(AST_DEPRECATE_TEXT))
- ///////////////////////////////////////////////////////////////////////////
- // INCLUDES
- ///////////////////////////////////////////////////////////////////////////
- #include <oledb.h>
- // If the compiler version is lower than VC7 LARGE_INTEGER is defined in largeint.h
- // VC7 Platform SDK defines LARGE_INTEGER in winnt.h
- #if _MSC_VER < 1300
- #include <largeint.h>
- #else
- #include <winnt.h>
- #endif
- #include "asisys.h"
- ///////////////////////////////////////////////////////////////////////////
- // FORWARD DEFINITIONS
- ///////////////////////////////////////////////////////////////////////////
- // ASI Class Hierarchy
- //
- class DLLScope CAsiObject; // Superclass for all classes
- class DLLScope CAsiIdent; // Identifier
- class DLLScope CAsiData; // ASI Data generic class
- class DLLScope CAsiNum; // Numeric data
- class DLLScope CAsiExactNum; // Exact numeric data
- class DLLScope CAsiSmallInt; // Small Integer
- class DLLScope CAsiInt; // Integer
- class DLLScope CAsiNumeric; // Numeric
- class DLLScope CAsiDecimal; // Decimal
- class DLLScope CAsiApproxNum; // Approximate numeric data
- class DLLScope CAsiFloat; // Float
- class DLLScope CAsiReal; // Real
- class DLLScope CAsiDouble; // Double precision
- class DLLScope CAsiChar; // Character
- class DLLScope CAsiBinary; // Bit
- class DLLScope CAsiIQualifier; // Interval qualifier
- class DLLScope CAsiInterval; // Interval
- class DLLScope CAsiYM; // Year month intervals
- class DLLScope CAsiDT; // Day Time intervals
- class DLLScope CAsiDatetime; // Datetime data
- class DLLScope CAsiDate; // Date
- class DLLScope CAsiTime; // Time
- class DLLScope CAsiTimeStamp; // Timestamp
- class DLLScope CAsiBlob; // OLEDB BLOBs
- class DLLScope CAsiColumn; // Column definition
- class DLLScope CAsiRow; // Array of columns
- class DLLScope CAsiHostBuffer; // Host program buffer
- class DLLScope CAsiParameter; // Parameter desriptor
- class DLLScope CAsiImplDefFunc; // Function
- // Class collections
- class DLLScope CAsiIRow; // Array of data pointers
- class DLLScope CAsiList; // List of CAsiObject's
- class DLLScope CAsiUcStr; // Unicode string
- class DLLScope CAsiUcChar; // Unicode character
- class DLLScope CAsiObjPack; // Communication buffer access
- typedef char ASIBCD [34]; // Decimal number
- // bcd[0] actual scale
- // bcd[1] sign
- // bcd[2-33] 32 digits unpacked BCD
- #include "asiconst.h"
- #include "asiucode.h"
- #pragma pack (push, 8)
- ///////////////////////////////////////////////////////////////////////////
- class CAsiObject
- //
- // This class is a principal base class for ALL ASI classes. It provides
- // services for memory management by reloading new and delete operators.
- //
- {
- public:
- CAsiObject (void);
- virtual ~CAsiObject (void);
- void* operator new (size_t);
- void operator delete (void*);
- #if defined(__WATCOMC__)
- void* operator new[] (unsigned int);
- void operator delete[] (void*);
- #endif /* __WATCOMC__ */
- // Duplicate
- //
- virtual CAsiObject * duplicate (void) const;
- // Nullify all members
- //
- virtual void Clear (void);
- // Runtime class iteraction functions. Used internaly
- //
- virtual unsigned long packSize (void) const;
- virtual unsigned long packTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackFrom (CAsiObjPack *);
- virtual unsigned long packValueSize (void) const;
- virtual unsigned long packValueTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackValueFrom (CAsiObjPack *);
- };
- ////////////////////////////////////////////////////////////////////////////////
- class CAsiIdent : public CAsiObject
- //
- // SQL Identifier. Most SQL names are represented as identifiers.
- // Identifier can be regular and delimitered.
- //
- // Regular identifier body must begin from the letter and contain
- // letters, underscope, and digits. ASI convertes regular
- // identifier body to upper case.
- // Delimited identifier can contain arbitrary symbol. In
- // SQL statements delimeted identifiers are enclosed into double
- // quotas
- //
- {
- public:
- // Construct identifier
- //
- CAsiIdent (void);
- CAsiIdent (const char *);
- CAsiIdent (const AsiUcStr);
- CAsiIdent (const CAsiUcStr &);
- CAsiIdent (const CAsiUcStr &, const CAsiUcStr &);
- CAsiIdent (const CAsiIdent &);
- virtual ~CAsiIdent (void);
- // Set and get identifier value
- //
- void set (EAsiBoolean,
- const CAsiUcStr &,
- const CAsiUcStr &);
- void setDelimited (EAsiBoolean);
- void setDelimited (void);
- void setCharSet (const CAsiUcStr &);
- // fParse = false, do not parse body. store it as it is
- void setBody (const CAsiUcStr &, EAsiBoolean fParse = kAsiTrue);
- EAsiBoolean isDelimited (void) const; // True if delimitered identifier
- const CAsiUcStr & CharSet (void) const;
- const CAsiUcStr & Body (void) const;
- // Length of Identifer (inc. introducer, char set name and
- // identifier itself
- int Length (void) const;
- // Clear components
- //
- virtual void Clear (void);
- // Operators
- //
- CAsiIdent & operator= (const CAsiIdent &); // Assign another identifier
- CAsiIdent & operator= (const CAsiUcStr &); // Assign regular identifier
- int operator== (const CAsiIdent &) const;
- // Print identifier
- //
- void ToString (CAsiUcStr *) const; // Append identifier to string
- // Duplicate
- //
- virtual CAsiObject * duplicate (void) const;
- // Runtime class iteraction functions
- //
- virtual unsigned long packSize (void) const;
- virtual unsigned long packTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackFrom (CAsiObjPack *);
- private:
- EAsiBoolean isDelim; // Is delimited identifier
- CAsiUcStr charset; // Character set name
- CAsiUcStr ident; // Identifier body
- };
- ////////////////////////////////////////////////////////////////////
- //
- // ASI Data classes
- //
- /////////////////////////////////////////////////////////////////////////
- //
- //
- //
- class CAsiData : public CAsiObject
- //
- // SQL Data
- //
- //
- // This class is a base class for all ASI data classes.
- // The basic functionality of it comprise the foolowing:
- // - Getting data type descriptor;
- // - Getting value in specified format;
- // - Storing value provided in arbitrary format;
- // - NULL value manipulating;
- // - Self duplicating
- //
- //
- // MEMBER FUNCTIONS:
- // -----------------
- //
- // Get data descriptor
- //
- // EAsiDataType Type (void) // type of data
- // EAsiDTType DateTimeType (void) // Datetime type
- // EAsiIType IntervalType (void) // Interval type
- // int ImplDataType (void) // Implemetation defined type
- // uint Length (void) // Length of character or bit data
- // uint Precision (void) // Precision
- // uint Scale (void) // Scale
- // uint TimePrec (void) // Time Precision
- // uint TimeStampPrec (void) // Timestamp precision
- // uint LeadFieldPrec (void) // Leading field precision
- // uint FracSecPrec (void) // Fractional second precision
- // uint ReturnLength (void) // Actual length of data
- //
- // The functions listed above allow to retrieve desription of the
- // the SQL data in terms of SQL. They are pure virtual functions,
- // actual transaltion of internal data descriptioon to the SQL data description
- // is done by the derived classes.
- //
- //
- // NULL value manipulation
- //
- // void setNull (void)
- //
- // Set internal data to NULL value (absence of value)
- //
- //
- // EAsiBoolean isNull (void) const
- //
- // Return kAsiTrue if data is NULL and kAsiFalse otherwise
- //
- //
- // Store Data value
- //
- // virtual EAsiBoolean storeValue (...);
- //
- // These functions allow to store data into class derived from
- // the CAsiData. Source data is converted to the actual type of the CAsiData
- // If conversion is possible and data was successfully stored and kAsiTrue is
- // returned, if conversion is impossible, kAsiFalse is returned.
- //
- //
- // Get data value
- //
- // virtual void getValue (...)
- //
- // Store value of the CAsiData object into destination buffer and perform all
- // needed converisons. If operation succeeded, kAsiTrue is returned, if not
- // kSiFalse is returned and contents of destination buffer is undefined.
- // If null value is stored, destination buffer contents is undefined.
- //
- // EAsiBoolean SQLType (CAsiUcStr * dst) const
- // EAsiBoolean SQLLiteral (CAsiUcStr * dst) const
- //
- // This functions stores SQL data type string and SQL literal into destination
- // buffer. For example, for Year to month interval first function will
- // return INTERVAL YEAR TO MONTH, the second one - INTERVAL 'yy-dd' YEAR TO MONTH
- //
- // Duplicate
- //
- // virtual CAsiObject *duplicate (void) const
- //
- // Create duplicate of the CAsiData object.
- //
- //
- // Operations with the Internal Data (Operators)
- //
- // Each class derived from CAsiData defines a set of functions that
- // perform certain operations with it. These functions comprise:
- // - assignment operator;
- // - arithmetics operator;
- // - data specific operations
- //
- // For more details see appropriate class definition.
- //
- //
- {
- friend class CAsiColumn;
- public:
- // Construction destruction
- //
- CAsiData (void);
- virtual ~CAsiData (void);
- // Get data descriptor
- //
- virtual EAsiDataType Type (void) const = 0; // type of data
- virtual EAsiDTType DateTimeType (void) const; // Datetime type
- virtual EAsiIType IntervalType (void) const; // Interval type
- virtual int ImplDataType (void) const; // Implemetation defined type
- virtual uint Length (void) const; // Length of character or bit data
- virtual uint Precision (void) const; // Precision
- virtual uint Scale (void) const; // Scale
- virtual uint TimePrec (void) const; // Time Precision
- virtual uint TimeStampPrec (void) const; // Timestamp precision
- virtual uint LeadFieldPrec (void) const; // Leading field precision
- virtual uint FracSecPrec (void) const; // Fractional second precision
- virtual uint ReturnLength (void) const; // Actual length of data
- // is_ functions
- //
- virtual EAsiBoolean is_numeric (void) const;
- virtual EAsiBoolean is_exactnumeric (void) const;
- virtual EAsiBoolean is_approxnumeric (void) const;
- virtual EAsiBoolean is_character (void) const;
- virtual EAsiBoolean is_binary (void) const;
- virtual EAsiBoolean is_datetime (void) const;
- virtual EAsiBoolean is_interval (void) const;
- virtual EAsiBoolean is_yminterval (void) const;
- virtual EAsiBoolean is_dtinterval (void) const;
- virtual EAsiBoolean is_implement (void) const;
- virtual EAsiBoolean is_comparable (const CAsiData *) const;
- virtual EAsiBoolean is_storable (const CAsiData *) const;
- virtual EAsiBoolean is_castable (const CAsiData *) const;
- // Check certain operations and return resulting descriptor
- virtual CAsiData * checkAdd (const CAsiData *) const;
- virtual CAsiData * checkSub (const CAsiData *) const;
- virtual CAsiData * checkMul (const CAsiData *) const;
- virtual CAsiData * checkDiv (const CAsiData *) const;
- virtual CAsiData * checkCat (const CAsiData *) const;
- virtual CAsiData * checkSet (const CAsiData *) const; // Set Operation result
- // Equal & Greater than relations
- virtual EAsiBoolean isEqualTo (const CAsiData &) const;
- virtual EAsiBoolean isGreaterThan (const CAsiData &) const;
- // Member function execution
- virtual CAsiImplDefFunc * getFuncDsc (const CAsiIdent &, const CAsiRow &) const;
- // NULL value manipulation
- //
- virtual void setNull (void); // Assign NULL
- virtual EAsiBoolean isNull (void) const; // Is Null ?
- // Store Data value
- //
- virtual EAsiBoolean storeValue (real); // Real
- virtual EAsiBoolean storeValue (integer); // Integer
- virtual EAsiBoolean storeValue (smallint); // Smallint
- virtual EAsiBoolean storeValue (char *, uint); // ASCII string
- virtual EAsiBoolean storeValue (const CAsiUcStr &); // Unicode string
- virtual EAsiBoolean storeValue (char *, uint, uint *); // Binary Buffer
- virtual EAsiBoolean storeValue (const CAsiData &); // store value to CAsiData (cast to)
- virtual EAsiBoolean storeValue (const AsiUcStr); // Store AsiUcStr
- virtual EAsiBoolean storeValue (const DECIMAL &);
- virtual EAsiBoolean storeValue (const DB_NUMERIC *);
- virtual EAsiBoolean storeValue (const DBDATE *);
- virtual EAsiBoolean storeValue (const DBTIME *);
- virtual EAsiBoolean storeValue (const DBTIMESTAMP *);
- // Retrive data value
- //
- virtual EAsiBoolean getValue (real *) const; // Real
- virtual EAsiBoolean getValue (integer *) const; // Integer
- virtual EAsiBoolean getValue (smallint *) const; // Smallint
- virtual EAsiBoolean getValue (char *, uint) const; // ASCII string
- virtual EAsiBoolean getValue (CAsiUcStr *) const; // Unicode string
- virtual EAsiBoolean getValue (char *, uint, uint *) const; // Binary Buffer
- virtual EAsiBoolean getValue (AsiUcStr, uint) const; // Unicode string
- virtual EAsiBoolean getValue (CAsiData &) const; // Get value from CAsiData (cast from)
- virtual EAsiBoolean getValue (DECIMAL *) const;
- virtual EAsiBoolean getValue (DB_NUMERIC *) const;
- virtual EAsiBoolean getValue (DBDATE *) const;
- virtual EAsiBoolean getValue (DBTIME *) const;
- virtual EAsiBoolean getValue (DBTIMESTAMP *) const;
- virtual EAsiBoolean SQLType (CAsiUcStr *) const = 0; // SQL data type as string
- virtual EAsiBoolean SQLLiteral (CAsiUcStr *) const = 0; // SQL compatible literal
- // OLE DB To Asi mapping
- static CAsiData * MapColumnInfoToAsi (DBCOLUMNINFO * pColumnInfo);
- static CAsiData * MapParamInfoToAsi (DBPARAMINFO * pParamInfo);
- virtual DBCOLUMNINFO * MapAsiToColumnInfo (DBCOLUMNINFO *) const;
- virtual DBPARAMINFO * MapAsiToParamInfo (DBPARAMINFO *) const;
- // Runtime class iteraction functions
- //
- // Duplicate itself
- //
- virtual CAsiObject* duplicate (void) const = 0;
- // Nullify all members
- virtual void Clear (void);
- protected:
- EAsiBoolean isnull; // kAsiTrue if data is null
- };
- ////////////////////////////////////////////////
- //
- //
- class CAsiNum : public CAsiData
- //
- // Numeric data
- //
- {
- friend class CAsiLex;
- protected:
- CAsiNum ();
- public:
- virtual ~CAsiNum ();
- // Get data descriptor
- //
- virtual uint Precision (void) const;
- virtual uint Scale (void) const;
- // is_ functions
- //
- virtual EAsiBoolean is_numeric (void) const;
- virtual EAsiBoolean is_exactnumeric (void) const;
- virtual EAsiBoolean is_approxnumeric(void) const;
- virtual EAsiBoolean is_comparable (const CAsiData *) const;
- virtual EAsiBoolean is_storable (const CAsiData *) const;
- virtual EAsiBoolean is_castable (const CAsiData *) const;
- virtual CAsiData * checkAdd (const CAsiData *) const;
- virtual CAsiData * checkSub (const CAsiData *) const;
- virtual CAsiData * checkMul (const CAsiData *) const;
- virtual CAsiData * checkDiv (const CAsiData *) const;
- // Get data value
- //
- virtual integer intValue (void) const;
- virtual real realValue (void) const;
- // virtual Comparision operators
- //
- virtual int operator> (const CAsiSmallInt &) const;
- virtual int operator> (const CAsiInt &) const;
- virtual int operator> (const CAsiNumeric &) const;
- virtual int operator> (const CAsiDecimal &) const;
- virtual int operator> (const CAsiFloat &) const;
- virtual int operator> (const CAsiReal &) const;
- virtual int operator> (const CAsiDouble &) const;
- virtual int operator> (const smallint) const;
- virtual int operator> (const integer) const;
- virtual int operator> (const real) const;
- virtual int operator> (const int) const;
- virtual int operator>= (const CAsiSmallInt &) const;
- virtual int operator>= (const CAsiInt &) const;
- virtual int operator>= (const CAsiNumeric &) const;
- virtual int operator>= (const CAsiDecimal &) const;
- virtual int operator>= (const CAsiFloat &) const;
- virtual int operator>= (const CAsiReal &) const;
- virtual int operator>= (const CAsiDouble &) const;
- virtual int operator>= (const smallint) const;
- virtual int operator>= (const integer) const;
- virtual int operator>= (const real) const;
- virtual int operator>= (const int) const;
- virtual int operator== (const CAsiSmallInt &) const;
- virtual int operator== (const CAsiInt &) const;
- virtual int operator== (const CAsiNumeric &) const;
- virtual int operator== (const CAsiDecimal &) const;
- virtual int operator== (const CAsiFloat &) const;
- virtual int operator== (const CAsiReal &) const;
- virtual int operator== (const CAsiDouble &) const;
- virtual int operator== (const smallint) const;
- virtual int operator== (const integer) const;
- virtual int operator== (const real) const;
- virtual int operator== (const int) const;
- virtual int operator<= (const CAsiSmallInt &) const;
- virtual int operator<= (const CAsiInt &) const;
- virtual int operator<= (const CAsiNumeric &) const;
- virtual int operator<= (const CAsiDecimal &) const;
- virtual int operator<= (const CAsiFloat &) const;
- virtual int operator<= (const CAsiReal &) const;
- virtual int operator<= (const CAsiDouble &) const;
- virtual int operator<= (const smallint) const;
- virtual int operator<= (const integer) const;
- virtual int operator<= (const real) const;
- virtual int operator<= (const int) const;
- virtual int operator< (const CAsiSmallInt &) const;
- virtual int operator< (const CAsiInt &) const;
- virtual int operator< (const CAsiNumeric &) const;
- virtual int operator< (const CAsiDecimal &) const;
- virtual int operator< (const CAsiFloat &) const;
- virtual int operator< (const CAsiReal &) const;
- virtual int operator< (const CAsiDouble &) const;
- virtual int operator< (const smallint) const;
- virtual int operator< (const integer) const;
- virtual int operator< (const real) const;
- virtual int operator< (const int) const;
- virtual int operator!= (const CAsiSmallInt &) const;
- virtual int operator!= (const CAsiInt &) const;
- virtual int operator!= (const CAsiNumeric &) const;
- virtual int operator!= (const CAsiDecimal &) const;
- virtual int operator!= (const CAsiFloat &) const;
- virtual int operator!= (const CAsiReal &) const;
- virtual int operator!= (const CAsiDouble &) const;
- virtual int operator!= (const smallint) const;
- virtual int operator!= (const integer) const;
- virtual int operator!= (const real) const;
- virtual int operator!= (const int) const;
- protected:
- uint precision;
- uint scale;
- };
- ////////////////////////////////////////////////
- //
- //
- class CAsiExactNum : public CAsiNum
- //
- // Exact numeric data
- //
- {
- protected:
- CAsiExactNum ();
- public:
- virtual ~CAsiExactNum ();
- // is_ functions
- //
- virtual EAsiBoolean is_exactnumeric (void) const;
- CAsiData * checkAdd (const CAsiData *) const;
- // Comparision operators
- //
- virtual int operator> (const CAsiSmallInt &) const;
- virtual int operator> (const CAsiInt &) const;
- virtual int operator> (const CAsiNumeric &) const;
- virtual int operator> (const CAsiDecimal &) const;
- virtual int operator> (const CAsiFloat &) const;
- virtual int operator> (const CAsiReal &) const;
- virtual int operator> (const CAsiDouble &) const;
- virtual int operator> (const smallint) const;
- virtual int operator> (const integer) const;
- virtual int operator> (const real) const;
- virtual int operator> (const int) const;
- virtual int operator>= (const CAsiSmallInt &) const;
- virtual int operator>= (const CAsiInt &) const;
- virtual int operator>= (const CAsiNumeric &) const;
- virtual int operator>= (const CAsiDecimal &) const;
- virtual int operator>= (const CAsiFloat &) const;
- virtual int operator>= (const CAsiReal &) const;
- virtual int operator>= (const CAsiDouble &) const;
- virtual int operator>= (const smallint) const;
- virtual int operator>= (const integer) const;
- virtual int operator>= (const real) const;
- virtual int operator>= (const int) const;
- virtual int operator== (const CAsiSmallInt &) const;
- virtual int operator== (const CAsiInt &) const;
- virtual int operator== (const CAsiNumeric &) const;
- virtual int operator== (const CAsiDecimal &) const;
- virtual int operator== (const CAsiFloat &) const;
- virtual int operator== (const CAsiReal &) const;
- virtual int operator== (const CAsiDouble &) const;
- virtual int operator== (const smallint) const;
- virtual int operator== (const integer) const;
- virtual int operator== (const real) const;
- virtual int operator== (const int) const;
- virtual int operator<= (const CAsiSmallInt &) const;
- virtual int operator<= (const CAsiInt &) const;
- virtual int operator<= (const CAsiNumeric &) const;
- virtual int operator<= (const CAsiDecimal &) const;
- virtual int operator<= (const CAsiFloat &) const;
- virtual int operator<= (const CAsiReal &) const;
- virtual int operator<= (const CAsiDouble &) const;
- virtual int operator<= (const smallint) const;
- virtual int operator<= (const integer) const;
- virtual int operator<= (const real) const;
- virtual int operator<= (const int) const;
- virtual int operator< (const CAsiSmallInt &) const;
- virtual int operator< (const CAsiInt &) const;
- virtual int operator< (const CAsiNumeric &) const;
- virtual int operator< (const CAsiDecimal &) const;
- virtual int operator< (const CAsiFloat &) const;
- virtual int operator< (const CAsiReal &) const;
- virtual int operator< (const CAsiDouble &) const;
- virtual int operator< (const smallint) const;
- virtual int operator< (const integer) const;
- virtual int operator< (const real) const;
- virtual int operator< (const int) const;
- virtual int operator!= (const CAsiSmallInt &) const;
- virtual int operator!= (const CAsiInt &) const;
- virtual int operator!= (const CAsiNumeric &) const;
- virtual int operator!= (const CAsiDecimal &) const;
- virtual int operator!= (const CAsiFloat &) const;
- virtual int operator!= (const CAsiReal &) const;
- virtual int operator!= (const CAsiDouble &) const;
- virtual int operator!= (const smallint) const;
- virtual int operator!= (const integer) const;
- virtual int operator!= (const real) const;
- virtual int operator!= (const int) const;
- protected:
- int cmpeqlen(const CAsiExactNum *) const;
- int cmpeqlan(const CAsiNum *) const;
- int cmpeqlenC(const real) const;
- int cmpneqen(const CAsiExactNum *) const;
- int cmpneqan(const CAsiNum *) const;
- int cmpneqenC(const real) const;
- int cmpltren(const CAsiExactNum *) const;
- int cmpltran(const CAsiNum *) const;
- int cmpltrenC(const real) const;
- int cmplteen(const CAsiExactNum *) const;
- int cmpltean(const CAsiNum *) const;
- int cmplteenC(const real) const;
- int cmpgtren(const CAsiExactNum *) const;
- int cmpgtran(const CAsiNum *) const;
- int cmpgtrenC(const real) const;
- int cmpgteen(const CAsiExactNum *) const;
- int cmpgtean(const CAsiNum *) const;
- int cmpgteenC(const real) const;
- };
- ////////////////////////////////////////////////
- //
- //
- class CAsiApproxNum : public CAsiNum
- //
- // Approximate numeric data
- //
- {
- protected:
- CAsiApproxNum (); // Constructor
- public:
- virtual ~CAsiApproxNum (); // Destructor
- // is_ functions
- //
- virtual EAsiBoolean is_approxnumeric (void) const;
- // Comparision operators
- //
- virtual int operator> (const CAsiSmallInt &) const;
- virtual int operator> (const CAsiInt &) const;
- virtual int operator> (const CAsiNumeric &) const;
- virtual int operator> (const CAsiDecimal &) const;
- virtual int operator> (const CAsiFloat &) const;
- virtual int operator> (const CAsiReal &) const;
- virtual int operator> (const CAsiDouble &) const;
- virtual int operator> (const smallint) const;
- virtual int operator> (const integer) const;
- virtual int operator> (const real) const;
- virtual int operator> (const int) const;
- virtual int operator>= (const CAsiSmallInt &) const;
- virtual int operator>= (const CAsiInt &) const;
- virtual int operator>= (const CAsiNumeric &) const;
- virtual int operator>= (const CAsiDecimal &) const;
- virtual int operator>= (const CAsiFloat &) const;
- virtual int operator>= (const CAsiReal &) const;
- virtual int operator>= (const CAsiDouble &) const;
- virtual int operator>= (const smallint) const;
- virtual int operator>= (const integer) const;
- virtual int operator>= (const real) const;
- virtual int operator>= (const int) const;
- virtual int operator== (const CAsiSmallInt &) const;
- virtual int operator== (const CAsiInt &) const;
- virtual int operator== (const CAsiNumeric &) const;
- virtual int operator== (const CAsiDecimal &) const;
- virtual int operator== (const CAsiFloat &) const;
- virtual int operator== (const CAsiReal &) const;
- virtual int operator== (const CAsiDouble &) const;
- virtual int operator== (const smallint) const;
- virtual int operator== (const integer) const;
- virtual int operator== (const real) const;
- virtual int operator== (const int) const;
- virtual int operator<= (const CAsiSmallInt &) const;
- virtual int operator<= (const CAsiInt &) const;
- virtual int operator<= (const CAsiNumeric &) const;
- virtual int operator<= (const CAsiDecimal &) const;
- virtual int operator<= (const CAsiFloat &) const;
- virtual int operator<= (const CAsiReal &) const;
- virtual int operator<= (const CAsiDouble &) const;
- virtual int operator<= (const smallint) const;
- virtual int operator<= (const integer) const;
- virtual int operator<= (const real) const;
- virtual int operator<= (const int) const;
- virtual int operator< (const CAsiSmallInt &) const;
- virtual int operator< (const CAsiInt &) const;
- virtual int operator< (const CAsiNumeric &) const;
- virtual int operator< (const CAsiDecimal &) const;
- virtual int operator< (const CAsiFloat &) const;
- virtual int operator< (const CAsiReal &) const;
- virtual int operator< (const CAsiDouble &) const;
- virtual int operator< (const smallint) const;
- virtual int operator< (const integer) const;
- virtual int operator< (const real) const;
- virtual int operator< (const int) const;
- virtual int operator!= (const CAsiSmallInt &) const;
- virtual int operator!= (const CAsiInt &) const;
- virtual int operator!= (const CAsiNumeric &) const;
- virtual int operator!= (const CAsiDecimal &) const;
- virtual int operator!= (const CAsiFloat &) const;
- virtual int operator!= (const CAsiReal &) const;
- virtual int operator!= (const CAsiDouble &) const;
- virtual int operator!= (const smallint) const;
- virtual int operator!= (const integer) const;
- virtual int operator!= (const real) const;
- virtual int operator!= (const int) const;
- protected:
- };
- ////////////////////////////////////////////////
- //
- //
- class CAsiSmallInt : public CAsiExactNum
- //
- // SMALL INTEGER
- //
- {
- public:
- CAsiSmallInt (void);
- CAsiSmallInt (const CAsiSmallInt &);
- virtual ~CAsiSmallInt (void);
- // Get data descriptor
- //
- virtual EAsiDataType Type (void) const;
- virtual uint ReturnLength (void) const;
- virtual EAsiBoolean isEqualTo (const CAsiData &) const;
- virtual EAsiBoolean isGreaterThan (const CAsiData &) const;
- virtual CAsiData * checkAdd (const CAsiData *) const;
- virtual CAsiData * checkSub (const CAsiData *) const;
- virtual CAsiData * checkMul (const CAsiData *) const;
- virtual CAsiData * checkDiv (const CAsiData *) const;
- virtual CAsiData * checkSet (const CAsiData *) const;
- // Store Data value
- //
- virtual EAsiBoolean storeValue (real) ;
- virtual EAsiBoolean storeValue (integer) ;
- virtual EAsiBoolean storeValue (smallint) ;
- virtual EAsiBoolean storeValue (char *, uint) ;
- virtual EAsiBoolean storeValue (const CAsiUcStr &) ;
- virtual EAsiBoolean storeValue (const CAsiData &);
- // ****
- virtual EAsiBoolean storeValue (char *, uint, uint *);
- virtual EAsiBoolean storeValue (const AsiUcStr);
- // Get data value
- //
- virtual integer intValue (void) const;
- virtual real realValue (void) const;
- virtual EAsiBoolean getValue (real *) const;
- virtual EAsiBoolean getValue (integer *) const;
- virtual EAsiBoolean getValue (smallint *) const;
- virtual EAsiBoolean getValue (char *, uint) const;
- virtual EAsiBoolean getValue (CAsiUcStr *) const;
- // ****
- virtual EAsiBoolean getValue (char *, uint, uint *) const; // Binary Buffer
- virtual EAsiBoolean getValue (AsiUcStr, uint) const; // Unicode string
- virtual EAsiBoolean getValue (CAsiData &) const;
- virtual DBCOLUMNINFO * MapAsiToColumnInfo (DBCOLUMNINFO *) const;
- virtual DBPARAMINFO * MapAsiToParamInfo (DBPARAMINFO *) const;
- virtual EAsiBoolean SQLType (CAsiUcStr *) const; // SQL data type as string
- virtual EAsiBoolean SQLLiteral (CAsiUcStr *) const; // SQL compatible literal
- // Runtime class iteraction functions
- //
- virtual unsigned long packSize (void) const;
- virtual unsigned long packTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackFrom (CAsiObjPack *);
- virtual unsigned long packValueSize (void) const;
- virtual unsigned long packValueTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackValueFrom (CAsiObjPack *) ;
- // Duplicate itself
- //
- virtual CAsiObject *duplicate (void) const;
- // Operators
- //
- // Assignment
- CAsiSmallInt &operator= (const CAsiSmallInt &);
- CAsiSmallInt &operator= (const CAsiInt &);
- CAsiSmallInt &operator= (const CAsiNumeric &);
- CAsiSmallInt &operator= (const CAsiDecimal &);
- CAsiSmallInt &operator= (const CAsiFloat &);
- CAsiSmallInt &operator= (const CAsiReal &);
- CAsiSmallInt &operator= (const CAsiDouble &);
- CAsiSmallInt &operator= (const smallint);
- CAsiSmallInt &operator= (const integer);
- CAsiSmallInt &operator= (const real);
- CAsiSmallInt &operator= (const int);
- // Arithmetic operators
- CAsiSmallInt &operator+= (const CAsiSmallInt &);
- CAsiSmallInt &operator+= (const CAsiInt &);
- CAsiSmallInt &operator+= (const CAsiNumeric &);
- CAsiSmallInt &operator+= (const CAsiDecimal &);
- CAsiSmallInt &operator+= (const CAsiFloat &);
- CAsiSmallInt &operator+= (const CAsiReal &);
- CAsiSmallInt &operator+= (const CAsiDouble &);
- CAsiSmallInt &operator+= (const smallint);
- CAsiSmallInt &operator+= (const integer);
- CAsiSmallInt &operator+= (const real);
- CAsiSmallInt &operator+= (const int);
- CAsiSmallInt &operator-= (const CAsiSmallInt &);
- CAsiSmallInt &operator-= (const CAsiInt &);
- CAsiSmallInt &operator-= (const CAsiNumeric &);
- CAsiSmallInt &operator-= (const CAsiDecimal &);
- CAsiSmallInt &operator-= (const CAsiFloat &);
- CAsiSmallInt &operator-= (const CAsiReal &);
- CAsiSmallInt &operator-= (const CAsiDouble &);
- CAsiSmallInt &operator-= (const smallint);
- CAsiSmallInt &operator-= (const integer);
- CAsiSmallInt &operator-= (const real);
- CAsiSmallInt &operator-= (const int);
- CAsiSmallInt &operator*= (const CAsiSmallInt &);
- CAsiSmallInt &operator*= (const CAsiInt &);
- CAsiSmallInt &operator*= (const CAsiNumeric &);
- CAsiSmallInt &operator*= (const CAsiDecimal &);
- CAsiSmallInt &operator*= (const CAsiFloat &);
- CAsiSmallInt &operator*= (const CAsiReal &);
- CAsiSmallInt &operator*= (const CAsiDouble &);
- CAsiSmallInt &operator*= (const smallint);
- CAsiSmallInt &operator*= (const integer);
- CAsiSmallInt &operator*= (const real);
- CAsiSmallInt &operator*= (const int);
- CAsiSmallInt &operator/= (const CAsiSmallInt &);
- CAsiSmallInt &operator/= (const CAsiInt &);
- CAsiSmallInt &operator/= (const CAsiNumeric &);
- CAsiSmallInt &operator/= (const CAsiDecimal &);
- CAsiSmallInt &operator/= (const CAsiFloat &);
- CAsiSmallInt &operator/= (const CAsiReal &);
- CAsiSmallInt &operator/= (const CAsiDouble &);
- CAsiSmallInt &operator/= (const smallint);
- CAsiSmallInt &operator/= (const integer);
- CAsiSmallInt &operator/= (const real);
- CAsiSmallInt &operator/= (const int);
- CAsiDouble operator+ (const CAsiSmallInt &) const;
- CAsiDouble operator+ (const smallint) const;
- CAsiDouble operator+ (const integer) const;
- CAsiDouble operator+ (const real) const;
- CAsiDouble operator+ (const int) const;
- friend CAsiDouble DLLScope operator+ (const smallint, const CAsiSmallInt &);
- friend CAsiDouble DLLScope operator+ (const integer, const CAsiSmallInt &);
- friend CAsiDouble DLLScope operator+ (const real, const CAsiSmallInt &);
- friend CAsiDouble DLLScope operator+ (const int, const CAsiSmallInt &);
- CAsiDouble operator- (const CAsiSmallInt &) const;
- CAsiDouble operator- (const smallint) const;
- CAsiDouble operator- (const integer) const;
- CAsiDouble operator- (const real) const;
- CAsiDouble operator- (const int) const;
- friend CAsiDouble DLLScope operator- (const smallint, const CAsiSmallInt &);
- friend CAsiDouble DLLScope operator- (const integer, const CAsiSmallInt &);
- friend CAsiDouble DLLScope operator- (const real, const CAsiSmallInt &);
- friend CAsiDouble DLLScope operator- (const int, const CAsiSmallInt &);
- CAsiDouble operator* (const CAsiSmallInt &) const;
- CAsiDouble operator* (const smallint) const;
- CAsiDouble operator* (const integer) const;
- CAsiDouble operator* (const real) const;
- CAsiDouble operator* (const int) const;
- friend CAsiDouble DLLScope operator* (const smallint, const CAsiSmallInt &);
- friend CAsiDouble DLLScope operator* (const integer, const CAsiSmallInt &);
- friend CAsiDouble DLLScope operator* (const real, const CAsiSmallInt &);
- friend CAsiDouble DLLScope operator* (const int, const CAsiSmallInt &);
- CAsiDouble operator/ (const CAsiSmallInt &) const;
- CAsiDouble operator/ (const smallint) const;
- CAsiDouble operator/ (const integer) const;
- CAsiDouble operator/ (const real) const;
- CAsiDouble operator/ (const int) const;
- friend CAsiDouble DLLScope operator/ (const smallint, const CAsiSmallInt &);
- friend CAsiDouble DLLScope operator/ (const integer, const CAsiSmallInt &);
- friend CAsiDouble DLLScope operator/ (const real, const CAsiSmallInt &);
- friend CAsiDouble DLLScope operator/ (const int, const CAsiSmallInt &);
- CAsiSmallInt &operator-- (void);
- CAsiSmallInt &operator++ (void);
- CAsiSmallInt &operator- (void);
- private:
- smallint sivalue;
- };
- ////////////////////////////////////////////////
- //
- //
- class CAsiInt : public CAsiExactNum
- //
- // INTEGER
- //
- // This class introduces functionality of the SQL INTEGER data type.
- // It redefines all arithmetic and comparision operators in which
- // integer number can be involved in SQL. Memeber functions also allow
- // to set and retrieve value of the internal integer number in double and
- // integer formats.
- //
- {
- public:
- CAsiInt ();
- CAsiInt (const CAsiInt &);
- virtual ~CAsiInt ();
- // Get data descriptor
- //
- virtual EAsiDataType Type (void) const;
- virtual uint ReturnLength (void) const;
- virtual CAsiData * checkAdd (const CAsiData *) const;
- virtual CAsiData * checkSub (const CAsiData *) const;
- virtual CAsiData * checkMul (const CAsiData *) const;
- virtual CAsiData * checkDiv (const CAsiData *) const;
- virtual CAsiData * checkSet (const CAsiData *) const;
- virtual EAsiBoolean isEqualTo (const CAsiData &) const;
- virtual EAsiBoolean isGreaterThan (const CAsiData &) const;
- // Store Data value
- //
- virtual EAsiBoolean storeValue (real);
- virtual EAsiBoolean storeValue (integer);
- virtual EAsiBoolean storeValue (smallint);
- virtual EAsiBoolean storeValue (char *, uint);
- virtual EAsiBoolean storeValue (const CAsiUcStr &);
- virtual EAsiBoolean storeValue (const CAsiData &);
- // ****
- virtual EAsiBoolean storeValue (char *, uint, uint *);
- virtual EAsiBoolean storeValue (const AsiUcStr);
- // Get data value
- //
- virtual integer intValue (void) const;
- virtual real realValue (void) const;
- virtual EAsiBoolean getValue (real *) const;
- virtual EAsiBoolean getValue (integer *) const;
- virtual EAsiBoolean getValue (smallint *) const;
- virtual EAsiBoolean getValue (char *, uint) const;
- virtual EAsiBoolean getValue (CAsiUcStr *) const;
- // ****
- virtual EAsiBoolean getValue (char *, uint, uint *) const; // Binary Buffer
- virtual EAsiBoolean getValue (AsiUcStr, uint) const; // Unicode string
- virtual EAsiBoolean getValue (CAsiData &) const;
- virtual DBCOLUMNINFO * MapAsiToColumnInfo (DBCOLUMNINFO *) const;
- virtual DBPARAMINFO * MapAsiToParamInfo (DBPARAMINFO *) const;
- virtual EAsiBoolean SQLType (CAsiUcStr *) const; // SQL data type as string
- virtual EAsiBoolean SQLLiteral (CAsiUcStr *) const; // SQL compatible literal
- // Runtime class iteraction functions
- //
- virtual unsigned long packSize (void) const;
- virtual unsigned long packTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackFrom (CAsiObjPack *);
- virtual unsigned long packValueSize (void) const;
- virtual unsigned long packValueTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackValueFrom (CAsiObjPack *) ;
- // Duplicate itself
- //
- virtual CAsiObject *duplicate (void) const;
- // Operators
- //
- // Assignment
- CAsiInt &operator= (const CAsiSmallInt &);
- CAsiInt &operator= (const CAsiInt &);
- CAsiInt &operator= (const CAsiNumeric &);
- CAsiInt &operator= (const CAsiDecimal &);
- CAsiInt &operator= (const CAsiFloat &);
- CAsiInt &operator= (const CAsiReal &);
- CAsiInt &operator= (const CAsiDouble &);
- CAsiInt &operator= (const smallint);
- CAsiInt &operator= (const integer);
- CAsiInt &operator= (const real);
- CAsiInt &operator= (const int);
- // Arithmetic operators
- CAsiInt &operator+= (const CAsiSmallInt &);
- CAsiInt &operator+= (const CAsiInt &);
- CAsiInt &operator+= (const CAsiNumeric &);
- CAsiInt &operator+= (const CAsiDecimal &);
- CAsiInt &operator+= (const CAsiFloat &);
- CAsiInt &operator+= (const CAsiReal &);
- CAsiInt &operator+= (const CAsiDouble &);
- CAsiInt &operator+= (const smallint);
- CAsiInt &operator+= (const integer);
- CAsiInt &operator+= (const real);
- CAsiInt &operator+= (const int);
- CAsiInt &operator-= (const CAsiSmallInt &);
- CAsiInt &operator-= (const CAsiInt &);
- CAsiInt &operator-= (const CAsiNumeric &);
- CAsiInt &operator-= (const CAsiDecimal &);
- CAsiInt &operator-= (const CAsiFloat &);
- CAsiInt &operator-= (const CAsiReal &);
- CAsiInt &operator-= (const CAsiDouble &);
- CAsiInt &operator-= (const smallint);
- CAsiInt &operator-= (const integer);
- CAsiInt &operator-= (const real);
- CAsiInt &operator-= (const int);
- CAsiInt &operator*= (const CAsiSmallInt &);
- CAsiInt &operator*= (const CAsiInt &);
- CAsiInt &operator*= (const CAsiNumeric &);
- CAsiInt &operator*= (const CAsiDecimal &);
- CAsiInt &operator*= (const CAsiFloat &);
- CAsiInt &operator*= (const CAsiReal &);
- CAsiInt &operator*= (const CAsiDouble &);
- CAsiInt &operator*= (const smallint);
- CAsiInt &operator*= (const integer);
- CAsiInt &operator*= (const real);
- CAsiInt &operator*= (const int);
- CAsiInt &operator/= (const CAsiSmallInt &);
- CAsiInt &operator/= (const CAsiInt &);
- CAsiInt &operator/= (const CAsiNumeric &);
- CAsiInt &operator/= (const CAsiDecimal &);
- CAsiInt &operator/= (const CAsiFloat &);
- CAsiInt &operator/= (const CAsiReal &);
- CAsiInt &operator/= (const CAsiDouble &);
- CAsiInt &operator/= (const smallint);
- CAsiInt &operator/= (const integer);
- CAsiInt &operator/= (const real);
- CAsiInt &operator/= (const int);
- CAsiDouble operator+ (const CAsiSmallInt &) const;
- friend CAsiDouble DLLScope operator+ (const CAsiSmallInt &, const CAsiInt &);
- CAsiDouble operator+ (const CAsiInt &) const;
- CAsiDouble operator+ (const smallint) const;
- friend CAsiDouble DLLScope operator+ (const smallint, const CAsiInt &);
- CAsiDouble operator+ (const integer) const;
- friend CAsiDouble DLLScope operator+ (const integer, const CAsiInt &);
- CAsiDouble operator+ (const real) const;
- friend CAsiDouble DLLScope operator+ (const real, const CAsiInt &);
- CAsiDouble operator+ (const int) const;
- friend CAsiDouble DLLScope operator+ (const int, const CAsiInt &);
- CAsiDouble operator- (const CAsiSmallInt &) const;
- friend CAsiDouble DLLScope operator- (const CAsiSmallInt &, const CAsiInt &);
- CAsiDouble operator- (const CAsiInt &) const;
- CAsiDouble operator- (const smallint) const;
- friend CAsiDouble DLLScope operator- (const smallint, const CAsiInt &);
- CAsiDouble operator- (const integer) const;
- friend CAsiDouble DLLScope operator- (const integer, const CAsiInt &);
- CAsiDouble operator- (const real) const;
- friend CAsiDouble DLLScope operator- (const real, const CAsiInt &);
- CAsiDouble operator- (const int) const;
- friend CAsiDouble DLLScope operator- (const int, const CAsiInt &);
- CAsiDouble operator* (const CAsiSmallInt &) const;
- friend CAsiDouble DLLScope operator* (const CAsiSmallInt &, const CAsiInt &);
- CAsiDouble operator* (const CAsiInt &) const;
- CAsiDouble operator* (const smallint) const;
- friend CAsiDouble DLLScope operator* (const smallint, const CAsiInt &);
- CAsiDouble operator* (const integer) const;
- friend CAsiDouble DLLScope operator* (const integer, const CAsiInt &);
- CAsiDouble operator* (const real) const;
- friend CAsiDouble DLLScope operator* (const real, const CAsiInt &);
- CAsiDouble operator* (const int) const;
- friend CAsiDouble DLLScope operator* (const int, const CAsiInt &);
- CAsiDouble operator/ (const CAsiSmallInt &) const;
- friend CAsiDouble DLLScope operator/ (const CAsiSmallInt &, const CAsiInt &);
- CAsiDouble operator/ (const CAsiInt &) const;
- CAsiDouble operator/ (const smallint) const;
- friend CAsiDouble DLLScope operator/ (const smallint, const CAsiInt &);
- CAsiDouble operator/ (const integer) const;
- friend CAsiDouble DLLScope operator/ (const integer, const CAsiInt &);
- CAsiDouble operator/ (const real) const;
- friend CAsiDouble DLLScope operator/ (const real, const CAsiInt &);
- CAsiDouble operator/ (const int) const;
- friend CAsiDouble DLLScope operator/ (const int, const CAsiInt &);
- CAsiInt &operator-- (void);
- CAsiInt &operator++ (void);
- CAsiInt &operator- (void);
- private:
- integer ivalue;
- };
- ////////////////////////////////////////////////
- //
- //
- class CAsiNumeric: public CAsiExactNum
- //
- // NUMERIC
- //
- {
- friend class CAsiDecimal;
- private:
- // private helper
- EAsiBoolean SetNumeric (real);
- //
- public:
- CAsiNumeric (uint, uint);
- CAsiNumeric (uint);
- CAsiNumeric (const CAsiNumeric &);
- CAsiNumeric (void);
- virtual ~CAsiNumeric (void);
- // Get data descriptor
- //
- virtual EAsiDataType Type (void) const;
- virtual uint ReturnLength (void) const;
- virtual CAsiData * checkAdd (const CAsiData *) const;
- virtual CAsiData * checkSub (const CAsiData *) const;
- virtual CAsiData * checkMul (const CAsiData *) const;
- virtual CAsiData * checkDiv (const CAsiData *) const;
- virtual CAsiData * checkSet (const CAsiData *) const;
- virtual EAsiBoolean isEqualTo (const CAsiData &) const;
- virtual EAsiBoolean isGreaterThan (const CAsiData &) const;
- // Store Data value
- //
- virtual EAsiBoolean storeValue (real);
- virtual EAsiBoolean storeValue (integer);
- virtual EAsiBoolean storeValue (smallint);
- virtual EAsiBoolean storeValue (char *, uint);
- virtual EAsiBoolean storeValue (const CAsiUcStr &);
- virtual EAsiBoolean storeValue (const CAsiData &);
- virtual EAsiBoolean storeValue (const DB_NUMERIC *);
- // ****
- virtual EAsiBoolean storeValue (char *, uint, uint *);
- virtual EAsiBoolean storeValue (const AsiUcStr);
- virtual DBCOLUMNINFO * MapAsiToColumnInfo (DBCOLUMNINFO *) const;
- virtual DBPARAMINFO * MapAsiToParamInfo (DBPARAMINFO *) const;
- virtual EAsiBoolean SQLType (CAsiUcStr *) const; // SQL data type as string
- virtual EAsiBoolean SQLLiteral (CAsiUcStr *) const; // SQL compatible literal
- // Get data value
- //
- virtual integer intValue (void) const;
- virtual real realValue (void) const;
- virtual EAsiBoolean getValue (real *) const;
- virtual EAsiBoolean getValue (integer *) const;
- virtual EAsiBoolean getValue (smallint *) const;
- virtual EAsiBoolean getValue (char *, uint) const;
- virtual EAsiBoolean getValue (CAsiUcStr *) const;
- virtual EAsiBoolean getValue (DB_NUMERIC *) const;
- // ****
- virtual EAsiBoolean getValue (char *, uint, uint *) const; // Binary Buffer
- virtual EAsiBoolean getValue (AsiUcStr, uint) const; // Unicode string
- virtual EAsiBoolean getValue (CAsiData &) const;
- // Runtime class iteraction functions
- //
- virtual unsigned long packSize (void) const;
- virtual unsigned long packTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackFrom (CAsiObjPack *);
- virtual unsigned long packValueSize (void) const;
- virtual unsigned long packValueTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackValueFrom (CAsiObjPack *) ;
- // Duplicate itself
- //
- virtual CAsiObject *duplicate (void) const;
- // Operators
- //
- // Assignment
- CAsiNumeric &operator= (const CAsiSmallInt &);
- CAsiNumeric &operator= (const CAsiInt &);
- CAsiNumeric &operator= (const CAsiNumeric &);
- CAsiNumeric &operator= (const CAsiDecimal &);
- CAsiNumeric &operator= (const CAsiFloat &);
- CAsiNumeric &operator= (const CAsiReal &);
- CAsiNumeric &operator= (const CAsiDouble &);
- CAsiNumeric &operator= (const smallint);
- CAsiNumeric &operator= (const integer);
- CAsiNumeric &operator= (const real);
- CAsiNumeric &operator= (const int);
- // Arithmetic operators
- CAsiNumeric &operator+= (const CAsiSmallInt &);
- CAsiNumeric &operator+= (const CAsiInt &);
- CAsiNumeric &operator+= (const CAsiNumeric &);
- CAsiNumeric &operator+= (const CAsiDecimal &);
- CAsiNumeric &operator+= (const CAsiFloat &);
- CAsiNumeric &operator+= (const CAsiReal &);
- CAsiNumeric &operator+= (const CAsiDouble &);
- CAsiNumeric &operator+= (const smallint);
- CAsiNumeric &operator+= (const integer);
- CAsiNumeric &operator+= (const real);
- CAsiNumeric &operator+= (const int);
- CAsiNumeric &operator-= (const CAsiSmallInt &);
- CAsiNumeric &operator-= (const CAsiInt &);
- CAsiNumeric &operator-= (const CAsiNumeric &);
- CAsiNumeric &operator-= (const CAsiDecimal &);
- CAsiNumeric &operator-= (const CAsiFloat &);
- CAsiNumeric &operator-= (const CAsiReal &);
- CAsiNumeric &operator-= (const CAsiDouble &);
- CAsiNumeric &operator-= (const smallint);
- CAsiNumeric &operator-= (const integer);
- CAsiNumeric &operator-= (const real);
- CAsiNumeric &operator-= (const int);
- CAsiNumeric &operator*= (const CAsiSmallInt &);
- CAsiNumeric &operator*= (const CAsiInt &);
- CAsiNumeric &operator*= (const CAsiNumeric &);
- CAsiNumeric &operator*= (const CAsiDecimal &);
- CAsiNumeric &operator*= (const CAsiFloat &);
- CAsiNumeric &operator*= (const CAsiReal &);
- CAsiNumeric &operator*= (const CAsiDouble &);
- CAsiNumeric &operator*= (const smallint);
- CAsiNumeric &operator*= (const integer);
- CAsiNumeric &operator*= (const real);
- CAsiNumeric &operator*= (const int);
- CAsiNumeric &operator/= (const CAsiSmallInt &);
- CAsiNumeric &operator/= (const CAsiInt &);
- CAsiNumeric &operator/= (const CAsiNumeric &);
- CAsiNumeric &operator/= (const CAsiDecimal &);
- CAsiNumeric &operator/= (const CAsiFloat &);
- CAsiNumeric &operator/= (const CAsiReal &);
- CAsiNumeric &operator/= (const CAsiDouble &);
- CAsiNumeric &operator/= (const smallint);
- CAsiNumeric &operator/= (const integer);
- CAsiNumeric &operator/= (const real);
- CAsiNumeric &operator/= (const int);
- CAsiDouble operator+ (const CAsiSmallInt &) const;
- CAsiDouble operator+ (const CAsiInt &) const;
- CAsiDouble operator+ (const CAsiNumeric &) const;
- friend CAsiDouble DLLScope operator+ (const CAsiSmallInt &, const CAsiNumeric &);
- friend CAsiDouble DLLScope operator+ (const CAsiInt &, const CAsiNumeric &);
- CAsiDouble operator+ (const smallint) const;
- CAsiDouble operator+ (const integer) const;
- CAsiDouble operator+ (const real) const;
- CAsiDouble operator+ (const int) const;
- friend CAsiDouble DLLScope operator+ (const smallint, const CAsiNumeric &);
- friend CAsiDouble DLLScope operator+ (const integer, const CAsiNumeric &);
- friend CAsiDouble DLLScope operator+ (const real, const CAsiNumeric &);
- friend CAsiDouble DLLScope operator+ (const int, const CAsiNumeric &);
- CAsiDouble operator- (const CAsiSmallInt &) const;
- CAsiDouble operator- (const CAsiInt &) const;
- CAsiDouble operator- (const CAsiNumeric &) const;
- friend CAsiDouble DLLScope operator- (const CAsiSmallInt &, const CAsiNumeric &);
- friend CAsiDouble DLLScope operator- (const CAsiInt &, const CAsiNumeric &);
- CAsiDouble operator- (const smallint) const;
- CAsiDouble operator- (const integer) const;
- CAsiDouble operator- (const real) const;
- CAsiDouble operator- (const int) const;
- friend CAsiDouble DLLScope operator- (const smallint, const CAsiNumeric &);
- friend CAsiDouble DLLScope operator- (const integer, const CAsiNumeric &);
- friend CAsiDouble DLLScope operator- (const real, const CAsiNumeric &);
- friend CAsiDouble DLLScope operator- (const int, const CAsiNumeric &) ;
- CAsiDouble operator* (const CAsiSmallInt &) const;
- CAsiDouble operator* (const CAsiInt &) const;
- CAsiDouble operator* (const CAsiNumeric &) const;
- friend CAsiDouble DLLScope operator* (const CAsiSmallInt &, const CAsiNumeric &);
- friend CAsiDouble DLLScope operator* (const CAsiInt &, const CAsiNumeric &);
- CAsiDouble operator* (const smallint) const;
- CAsiDouble operator* (const integer) const;
- CAsiDouble operator* (const real) const;
- CAsiDouble operator* (const int) const;
- friend CAsiDouble DLLScope operator* (const smallint, const CAsiNumeric &);
- friend CAsiDouble DLLScope operator* (const integer, const CAsiNumeric &) ;
- friend CAsiDouble DLLScope operator* (const real, const CAsiNumeric &) ;
- friend CAsiDouble DLLScope operator* (const int, const CAsiNumeric &) ;
- CAsiDouble operator/ (const CAsiSmallInt &) const;
- CAsiDouble operator/ (const CAsiInt &) const;
- CAsiDouble operator/ (const CAsiNumeric &) const;
- friend CAsiDouble DLLScope operator/ (const CAsiSmallInt &, const CAsiNumeric &);
- friend CAsiDouble DLLScope operator/ (const CAsiInt &, const CAsiNumeric &) ;
- CAsiDouble operator/ (const smallint) const;
- CAsiDouble operator/ (const integer) const;
- CAsiDouble operator/ (const real) const;
- CAsiDouble operator/ (const int) const;
- friend CAsiDouble DLLScope operator/ (const smallint, const CAsiNumeric &);
- friend CAsiDouble DLLScope operator/ (const integer, const CAsiNumeric &) ;
- friend CAsiDouble DLLScope operator/ (const real, const CAsiNumeric &) ;
- friend CAsiDouble DLLScope operator/ (const int, const CAsiNumeric &) ;
- CAsiNumeric &operator++ (void);
- CAsiNumeric &operator-- (void);
- CAsiNumeric &operator- (void);
- private:
- ASIBCD bcdvalue;
- };
- ////////////////////////////////////////////////
- //
- //
- class CAsiDecimal: public CAsiExactNum
- //
- // DECIMAL
- //
- {
- friend class CAsiNumeric;
- private:
- // private helper
- EAsiBoolean SetDecimal (real);
- public:
- CAsiDecimal (uint, uint);
- CAsiDecimal (uint);
- CAsiDecimal (const CAsiDecimal &);
- CAsiDecimal (void);
- virtual ~CAsiDecimal (void);
- // Get data descriptor
- //
- virtual EAsiDataType Type (void) const;
- virtual uint ReturnLength (void) const;
- virtual CAsiData * checkAdd (const CAsiData *) const;
- virtual CAsiData * checkSub (const CAsiData *) const;
- virtual CAsiData * checkMul (const CAsiData *) const;
- virtual CAsiData * checkDiv (const CAsiData *) const;
- virtual CAsiData * checkSet (const CAsiData *) const;
- virtual EAsiBoolean isEqualTo (const CAsiData &) const;
- virtual EAsiBoolean isGreaterThan (const CAsiData &) const;
- // Store Data value
- //
- virtual EAsiBoolean storeValue (real);
- virtual EAsiBoolean storeValue (integer);
- virtual EAsiBoolean storeValue (smallint);
- virtual EAsiBoolean storeValue (char *, uint);
- virtual EAsiBoolean storeValue (const CAsiUcStr &);
- virtual EAsiBoolean storeValue (const CAsiData &);
- virtual EAsiBoolean storeValue (LARGE_INTEGER);
- virtual EAsiBoolean storeValue (ULARGE_INTEGER);
- virtual EAsiBoolean storeValue (const DECIMAL &);
- // ****
- virtual EAsiBoolean storeValue (char *, uint, uint *);
- virtual EAsiBoolean storeValue (const AsiUcStr);
- virtual DBCOLUMNINFO * MapAsiToColumnInfo (DBCOLUMNINFO *) const;
- virtual DBPARAMINFO * MapAsiToParamInfo (DBPARAMINFO *) const;
- virtual EAsiBoolean SQLType (CAsiUcStr *) const; // SQL data type as string
- virtual EAsiBoolean SQLLiteral (CAsiUcStr *) const; // SQL compatible literal
- // Get data value
- //
- virtual integer intValue (void) const;
- virtual real realValue (void) const;
- virtual EAsiBoolean getValue (real *) const;
- virtual EAsiBoolean getValue (integer *) const;
- virtual EAsiBoolean getValue (smallint *) const;
- virtual EAsiBoolean getValue (char *, uint) const;
- virtual EAsiBoolean getValue (CAsiUcStr *) const;
- virtual EAsiBoolean getValue (LARGE_INTEGER *) const;
- virtual EAsiBoolean getValue (ULARGE_INTEGER *) const;
- virtual EAsiBoolean getValue (DECIMAL *) const;
- // ****
- virtual EAsiBoolean getValue (char *, uint, uint *) const; // Binary Buffer
- virtual EAsiBoolean getValue (AsiUcStr, uint) const; // Unicode string
- virtual EAsiBoolean getValue (CAsiData &) const;
- // Runtime class iteraction functions
- //
- virtual unsigned long packSize (void) const;
- virtual unsigned long packTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackFrom (CAsiObjPack *);
- virtual unsigned long packValueSize (void) const;
- virtual unsigned long packValueTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackValueFrom (CAsiObjPack *);
- // Duplicate itself
- //
- virtual CAsiObject *duplicate (void) const;
- // Operators
- //
- // Assignment
- CAsiDecimal &operator= (const CAsiSmallInt &);
- CAsiDecimal &operator= (const CAsiInt &);
- CAsiDecimal &operator= (const CAsiNumeric &);
- CAsiDecimal &operator= (const CAsiDecimal &);
- CAsiDecimal &operator= (const CAsiFloat &);
- CAsiDecimal &operator= (const CAsiReal &);
- CAsiDecimal &operator= (const CAsiDouble &);
- CAsiDecimal &operator= (const smallint);
- CAsiDecimal &operator= (const integer);
- CAsiDecimal &operator= (const real);
- CAsiDecimal &operator= (const int);
- // Arithmetic operators
- CAsiDecimal &operator+= (const CAsiSmallInt &);
- CAsiDecimal &operator+= (const CAsiInt &);
- CAsiDecimal &operator+= (const CAsiNumeric &);
- CAsiDecimal &operator+= (const CAsiDecimal &);
- CAsiDecimal &operator+= (const CAsiFloat &);
- CAsiDecimal &operator+= (const CAsiReal &);
- CAsiDecimal &operator+= (const CAsiDouble &);
- CAsiDecimal &operator+= (const smallint);
- CAsiDecimal &operator+= (const integer);
- CAsiDecimal &operator+= (const real);
- CAsiDecimal &operator+= (const int);
- CAsiDecimal &operator-= (const CAsiSmallInt &);
- CAsiDecimal &operator-= (const CAsiInt &);
- CAsiDecimal &operator-= (const CAsiNumeric &);
- CAsiDecimal &operator-= (const CAsiDecimal &);
- CAsiDecimal &operator-= (const CAsiFloat &);
- CAsiDecimal &operator-= (const CAsiReal &);
- CAsiDecimal &operator-= (const CAsiDouble &);
- CAsiDecimal &operator-= (const smallint);
- CAsiDecimal &operator-= (const integer);
- CAsiDecimal &operator-= (const real);
- CAsiDecimal &operator-= (const int);
- CAsiDecimal &operator*= (const CAsiSmallInt &);
- CAsiDecimal &operator*= (const CAsiInt &);
- CAsiDecimal &operator*= (const CAsiNumeric &);
- CAsiDecimal &operator*= (const CAsiDecimal &);
- CAsiDecimal &operator*= (const CAsiFloat &);
- CAsiDecimal &operator*= (const CAsiReal &);
- CAsiDecimal &operator*= (const CAsiDouble &);
- CAsiDecimal &operator*= (const smallint);
- CAsiDecimal &operator*= (const integer);
- CAsiDecimal &operator*= (const real);
- CAsiDecimal &operator*= (const int);
- CAsiDecimal &operator/= (const CAsiSmallInt &);
- CAsiDecimal &operator/= (const CAsiInt &);
- CAsiDecimal &operator/= (const CAsiNumeric &);
- CAsiDecimal &operator/= (const CAsiDecimal &);
- CAsiDecimal &operator/= (const CAsiFloat &);
- CAsiDecimal &operator/= (const CAsiReal &);
- CAsiDecimal &operator/= (const CAsiDouble &);
- CAsiDecimal &operator/= (const smallint);
- CAsiDecimal &operator/= (const integer);
- CAsiDecimal &operator/= (const real);
- CAsiDecimal &operator/= (const int);
- CAsiDouble operator+ (const CAsiSmallInt &) const;
- CAsiDouble operator+ (const CAsiInt &) const;
- CAsiDouble operator+ (const CAsiNumeric &) const;
- CAsiDouble operator+ (const CAsiDecimal &) const;
- friend CAsiDouble DLLScope operator+ (const CAsiSmallInt &, const CAsiDecimal &);
- friend CAsiDouble DLLScope operator+ (const CAsiInt &, const CAsiDecimal &) ;
- friend CAsiDouble DLLScope operator+ (const CAsiNumeric &, const CAsiDecimal &) ;
- CAsiDouble operator+ (const smallint) const;
- CAsiDouble operator+ (const integer) const;
- CAsiDouble operator+ (const real) const;
- friend CAsiDouble DLLScope operator+ (const smallint, const CAsiDecimal &);
- friend CAsiDouble DLLScope operator+ (const integer, const CAsiDecimal &) ;
- friend CAsiDouble DLLScope operator+ (const real, const CAsiDecimal &) ;
- CAsiDouble operator+ (const int) const;
- friend CAsiDouble operator+ (const int, const CAsiDecimal &);
- CAsiDouble operator- (const CAsiSmallInt &) const;
- CAsiDouble operator- (const CAsiInt &) const;
- CAsiDouble operator- (const CAsiNumeric &) const;
- CAsiDouble operator- (const CAsiDecimal &) const;
- friend CAsiDouble DLLScope operator- (const CAsiSmallInt &, const CAsiDecimal &);
- friend CAsiDouble DLLScope operator- (const CAsiInt &, const CAsiDecimal &);
- friend CAsiDouble DLLScope operator- (const CAsiNumeric &, const CAsiDecimal &);
- CAsiDouble operator- (const smallint) const;
- CAsiDouble operator- (const integer) const;
- CAsiDouble operator- (const real) const;
- friend CAsiDouble DLLScope operator- (const smallint, const CAsiDecimal &);
- friend CAsiDouble DLLScope operator- (const integer, const CAsiDecimal &) ;
- friend CAsiDouble DLLScope operator- (const real, const CAsiDecimal &) ;
- CAsiDouble operator- (const int) const;
- friend CAsiDouble DLLScope operator- (const int, const CAsiDecimal &);
- CAsiDouble operator* (const CAsiSmallInt &) const;
- CAsiDouble operator* (const CAsiInt &) const;
- CAsiDouble operator* (const CAsiNumeric &) const;
- CAsiDouble operator* (const CAsiDecimal &) const;
- friend CAsiDouble DLLScope operator* (const CAsiSmallInt &, const CAsiDecimal &);
- friend CAsiDouble DLLScope operator* (const CAsiInt &, const CAsiDecimal &) ;
- friend CAsiDouble DLLScope operator* (const CAsiNumeric &, const CAsiDecimal &) ;
- CAsiDouble operator* (const smallint) const;
- CAsiDouble operator* (const integer) const;
- CAsiDouble operator* (const real) const;
- friend CAsiDouble DLLScope operator* (const smallint, const CAsiDecimal &);
- friend CAsiDouble DLLScope operator* (const integer, const CAsiDecimal &) ;
- friend CAsiDouble DLLScope operator* (const real, const CAsiDecimal &) ;
- CAsiDouble operator* (const int) const ;
- friend CAsiDouble DLLScope operator* (const int, const CAsiDecimal &) ;
- CAsiDouble operator/ (const CAsiSmallInt &) const;
- CAsiDouble operator/ (const CAsiInt &) const;
- CAsiDouble operator/ (const CAsiNumeric &) const;
- CAsiDouble operator/ (const CAsiDecimal &) const;
- friend CAsiDouble DLLScope operator/ (const CAsiSmallInt &, const CAsiDecimal &);
- friend CAsiDouble DLLScope operator/ (const CAsiInt &, const CAsiDecimal &);
- friend CAsiDouble DLLScope operator/ (const CAsiNumeric &, const CAsiDecimal &);
- CAsiDouble operator/ (const smallint) const;
- CAsiDouble operator/ (const integer) const;
- CAsiDouble operator/ (const real) const;
- friend CAsiDouble DLLScope operator/ (const smallint, const CAsiDecimal &);
- friend CAsiDouble DLLScope operator/ (const integer, const CAsiDecimal &) ;
- friend CAsiDouble DLLScope operator/ (const real, const CAsiDecimal &) ;
- CAsiDouble operator/ (const int) const;
- friend CAsiDouble DLLScope operator/ (const int, const CAsiDecimal &);
- CAsiDecimal &operator++ (void);
- CAsiDecimal &operator-- (void);
- CAsiDecimal &operator- (void);
- private:
- EAsiBoolean fmt;
- ASIBCD bcdvalue;
- double realvalue;
- };
- ////////////////////////////////////////////////
- //
- //
- class CAsiFloat: public CAsiApproxNum
- //
- // FLOAT
- //
- {
- public:
- CAsiFloat (void);
- CAsiFloat (uint);
- CAsiFloat (const CAsiFloat &);
- virtual ~CAsiFloat (void);
- // Get data descriptor
- //
- virtual EAsiDataType Type (void) const;
- virtual uint ReturnLength (void) const;
- virtual CAsiData * checkAdd (const CAsiData *) const;
- virtual CAsiData * checkSub (const CAsiData *) const;
- virtual CAsiData * checkMul (const CAsiData *) const;
- virtual CAsiData * checkDiv (const CAsiData *) const;
- virtual CAsiData * checkSet (const CAsiData *) const;
- virtual EAsiBoolean isEqualTo (const CAsiData &) const;
- virtual EAsiBoolean isGreaterThan (const CAsiData &) const;
- // Store Data value
- //
- virtual EAsiBoolean storeValue (real);
- virtual EAsiBoolean storeValue (integer);
- virtual EAsiBoolean storeValue (smallint);
- virtual EAsiBoolean storeValue (char *, uint);
- virtual EAsiBoolean storeValue (const CAsiUcStr &);
- virtual EAsiBoolean storeValue (const CAsiData &);
- // ****
- virtual EAsiBoolean storeValue (char *, uint, uint *);
- virtual EAsiBoolean storeValue (const AsiUcStr);
- virtual DBCOLUMNINFO *MapAsiToColumnInfo (DBCOLUMNINFO *) const;
- virtual DBPARAMINFO * MapAsiToParamInfo (DBPARAMINFO *) const;
- virtual EAsiBoolean SQLType (CAsiUcStr *) const; // SQL data type as string
- virtual EAsiBoolean SQLLiteral (CAsiUcStr *) const; // SQL compatible literal
- // Get data value
- //
- virtual integer intValue (void) const;
- virtual real realValue (void) const;
- virtual EAsiBoolean getValue (real *) const;
- virtual EAsiBoolean getValue (integer *) const;
- virtual EAsiBoolean getValue (smallint *) const;
- virtual EAsiBoolean getValue (char *, uint) const;
- virtual EAsiBoolean getValue (CAsiUcStr *) const;
- // ****
- virtual EAsiBoolean getValue (char *, uint, uint *) const; // Binary Buffer
- virtual EAsiBoolean getValue (AsiUcStr, uint) const; // Unicode string
- virtual EAsiBoolean getValue (CAsiData &) const;
- // Runtime class iteraction functions
- //
- virtual unsigned long packSize (void) const;
- virtual unsigned long packTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackFrom (CAsiObjPack *);
- virtual unsigned long packValueSize (void) const;
- virtual unsigned long packValueTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackValueFrom (CAsiObjPack *);
- // Duplicate itself
- //
- virtual CAsiObject *duplicate (void) const;
- // Operators
- //
- // Assignment
- CAsiFloat &operator= (const CAsiSmallInt &);
- CAsiFloat &operator= (const CAsiInt &);
- CAsiFloat &operator= (const CAsiNumeric &);
- CAsiFloat &operator= (const CAsiDecimal &);
- CAsiFloat &operator= (const CAsiFloat &);
- CAsiFloat &operator= (const CAsiReal &);
- CAsiFloat &operator= (const CAsiDouble &);
- CAsiFloat &operator= (const smallint);
- CAsiFloat &operator= (const integer);
- CAsiFloat &operator= (const real);
- CAsiFloat &operator= (const int);
- // Arithmetic operators
- CAsiFloat &operator+= (const CAsiSmallInt &);
- CAsiFloat &operator+= (const CAsiInt &);
- CAsiFloat &operator+= (const CAsiNumeric &);
- CAsiFloat &operator+= (const CAsiDecimal &);
- CAsiFloat &operator+= (const CAsiFloat &);
- CAsiFloat &operator+= (const CAsiReal &);
- CAsiFloat &operator+= (const CAsiDouble &);
- CAsiFloat &operator+= (const smallint);
- CAsiFloat &operator+= (const integer);
- CAsiFloat &operator+= (const real);
- CAsiFloat &operator+= (const int);
- CAsiFloat &operator-= (const CAsiSmallInt &);
- CAsiFloat &operator-= (const CAsiInt &);
- CAsiFloat &operator-= (const CAsiNumeric &);
- CAsiFloat &operator-= (const CAsiDecimal &);
- CAsiFloat &operator-= (const CAsiFloat &);
- CAsiFloat &operator-= (const CAsiReal &);
- CAsiFloat &operator-= (const CAsiDouble &);
- CAsiFloat &operator-= (const smallint);
- CAsiFloat &operator-= (const integer);
- CAsiFloat &operator-= (const real);
- CAsiFloat &operator-= (const int);
- CAsiFloat &operator*= (const CAsiSmallInt &);
- CAsiFloat &operator*= (const CAsiInt &);
- CAsiFloat &operator*= (const CAsiNumeric &);
- CAsiFloat &operator*= (const CAsiDecimal &);
- CAsiFloat &operator*= (const CAsiFloat &);
- CAsiFloat &operator*= (const CAsiReal &);
- CAsiFloat &operator*= (const CAsiDouble &);
- CAsiFloat &operator*= (const smallint);
- CAsiFloat &operator*= (const integer);
- CAsiFloat &operator*= (const real);
- CAsiFloat &operator*= (const int);
- CAsiFloat &operator/= (const CAsiSmallInt &);
- CAsiFloat &operator/= (const CAsiInt &);
- CAsiFloat &operator/= (const CAsiNumeric &);
- CAsiFloat &operator/= (const CAsiDecimal &);
- CAsiFloat &operator/= (const CAsiFloat &);
- CAsiFloat &operator/= (const CAsiReal &);
- CAsiFloat &operator/= (const CAsiDouble &);
- CAsiFloat &operator/= (const smallint);
- CAsiFloat &operator/= (const integer);
- CAsiFloat &operator/= (const real);
- CAsiFloat &operator/= (const int);
- CAsiFloat operator+ (const CAsiSmallInt &) const;
- CAsiFloat operator+ (const CAsiInt &) const;
- CAsiFloat operator+ (const CAsiNumeric &) const;
- CAsiFloat operator+ (const CAsiDecimal &) const;
- CAsiFloat operator+ (const CAsiFloat &) const;
- friend CAsiFloat DLLScope operator+ (const CAsiSmallInt &, const CAsiFloat &);
- friend CAsiFloat DLLScope operator+ (const CAsiInt &, const CAsiFloat &) ;
- friend CAsiFloat DLLScope operator+ (const CAsiNumeric &, const CAsiFloat &) ;
- friend CAsiFloat DLLScope operator+ (const CAsiDecimal &, const CAsiFloat &) ;
- CAsiFloat operator+ (const smallint) const;
- CAsiFloat operator+ (const integer) const;
- CAsiFloat operator+ (const real) const;
- friend CAsiFloat DLLScope operator+ (const smallint, const CAsiFloat &);
- friend CAsiFloat DLLScope operator+ (const integer, const CAsiFloat &) ;
- friend CAsiFloat DLLScope operator+ (const real, const CAsiFloat &) ;
- CAsiFloat operator+ (const int) const;
- friend CAsiFloat DLLScope operator+ (const int, const CAsiFloat &);
- CAsiFloat operator- (const CAsiSmallInt &) const;
- CAsiFloat operator- (const CAsiInt &) const;
- CAsiFloat operator- (const CAsiNumeric &) const;
- CAsiFloat operator- (const CAsiDecimal &) const;
- CAsiFloat operator- (const CAsiFloat &) const;
- friend CAsiFloat DLLScope operator- (const CAsiSmallInt &, const CAsiFloat &);
- friend CAsiFloat DLLScope operator- (const CAsiInt &, const CAsiFloat &);
- friend CAsiFloat DLLScope operator- (const CAsiNumeric &, const CAsiFloat &);
- friend CAsiFloat DLLScope operator- (const CAsiDecimal &, const CAsiFloat &);
- CAsiFloat operator- (const smallint) const;
- CAsiFloat operator- (const integer) const;
- CAsiFloat operator- (const real) const;
- friend CAsiFloat DLLScope operator- (const smallint, const CAsiFloat &);
- friend CAsiFloat DLLScope operator- (const integer, const CAsiFloat &);
- friend CAsiFloat DLLScope operator- (const real, const CAsiFloat &);
- CAsiFloat operator- (const int) const;
- friend CAsiFloat DLLScope operator- (const int, const CAsiFloat &);
- CAsiFloat operator* (const CAsiSmallInt &) const;
- CAsiFloat operator* (const CAsiInt &) const;
- CAsiFloat operator* (const CAsiNumeric &) const;
- CAsiFloat operator* (const CAsiDecimal &) const;
- CAsiFloat operator* (const CAsiFloat &) const;
- friend CAsiFloat DLLScope operator* (const CAsiSmallInt &, const CAsiFloat &);
- friend CAsiFloat DLLScope operator* (const CAsiInt &, const CAsiFloat &);
- friend CAsiFloat DLLScope operator* (const CAsiNumeric &, const CAsiFloat &);
- friend CAsiFloat DLLScope operator* (const CAsiDecimal &, const CAsiFloat &);
- CAsiFloat operator* (const smallint) const;
- CAsiFloat operator* (const integer) const;
- CAsiFloat operator* (const real) const;
- friend CAsiFloat DLLScope operator* (const smallint, const CAsiFloat &);
- friend CAsiFloat DLLScope operator* (const integer, const CAsiFloat &);
- friend CAsiFloat DLLScope operator* (const real, const CAsiFloat &);
- CAsiFloat operator* (const int) const;
- friend CAsiFloat DLLScope operator* (const int, const CAsiFloat &);
- CAsiFloat operator/ (const CAsiSmallInt &) const;
- CAsiFloat operator/ (const CAsiInt &) const;
- CAsiFloat operator/ (const CAsiNumeric &) const;
- CAsiFloat operator/ (const CAsiDecimal &) const;
- CAsiFloat operator/ (const CAsiFloat &) const;
- friend CAsiFloat DLLScope operator/ (const CAsiSmallInt &, const CAsiFloat &);
- friend CAsiFloat DLLScope operator/ (const CAsiInt &, const CAsiFloat &);
- friend CAsiFloat DLLScope operator/ (const CAsiNumeric &, const CAsiFloat &);
- friend CAsiFloat DLLScope operator/ (const CAsiDecimal &, const CAsiFloat &);
- CAsiFloat operator/ (const smallint) const;
- CAsiFloat operator/ (const integer) const;
- CAsiFloat operator/ (const real) const;
- friend CAsiFloat DLLScope operator/ (const smallint, const CAsiFloat &);
- friend CAsiFloat DLLScope operator/ (const integer, const CAsiFloat &);
- friend CAsiFloat DLLScope operator/ (const real, const CAsiFloat &) ;
- CAsiFloat operator/ (const int) const;
- friend CAsiFloat DLLScope operator/ (const int, const CAsiFloat &);
- CAsiFloat &operator++ (void);
- CAsiFloat &operator-- (void);
- CAsiFloat &operator- (void);
- private:
- real fvalue;
- };
- ////////////////////////////////////////////////
- //
- //
- class CAsiReal: public CAsiApproxNum
- //
- // REAL
- //
- // This class introduces functionality of the SQL REAL data.
- // It redefines all arithmetic and comparision operators in which
- // real number can be involved in SQL. Memeber functions also allow
- // to set and retrieve value of the internal real number in double and
- // integer formats.
- {
- public:
- CAsiReal (void);
- CAsiReal (const CAsiReal &);
- virtual ~CAsiReal (void);
- // Get data descriptor
- //
- virtual EAsiDataType Type (void) const;
- virtual uint ReturnLength (void) const;
- virtual CAsiData * checkAdd (const CAsiData *) const;
- virtual CAsiData * checkSub (const CAsiData *) const;
- virtual CAsiData * checkMul (const CAsiData *) const;
- virtual CAsiData * checkDiv (const CAsiData *) const;
- virtual CAsiData * checkSet (const CAsiData *) const;
- virtual EAsiBoolean isEqualTo (const CAsiData &) const;
- virtual EAsiBoolean isGreaterThan (const CAsiData &) const;
- // Store Data value
- //
- virtual EAsiBoolean storeValue (real);
- virtual EAsiBoolean storeValue (integer);
- virtual EAsiBoolean storeValue (smallint);
- virtual EAsiBoolean storeValue (char *, uint);
- virtual EAsiBoolean storeValue (const CAsiUcStr &);
- virtual EAsiBoolean storeValue (const CAsiData &);
- // ****
- virtual EAsiBoolean storeValue (char *, uint, uint *);
- virtual EAsiBoolean storeValue (const AsiUcStr);
- virtual EAsiBoolean SQLType (CAsiUcStr *) const; // SQL data type as string
- virtual EAsiBoolean SQLLiteral (CAsiUcStr *) const; // SQL compatible literal
- // Get data value
- //
- virtual integer intValue (void) const;
- virtual real realValue (void) const;
- virtual EAsiBoolean getValue (real *) const;
- virtual EAsiBoolean getValue (integer *) const;
- virtual EAsiBoolean getValue (smallint *) const;
- virtual EAsiBoolean getValue (char *, uint) const;
- virtual EAsiBoolean getValue (CAsiUcStr *) const;
- // ****
- virtual EAsiBoolean getValue (char *, uint, uint *) const; // Binary Buffer
- virtual EAsiBoolean getValue (AsiUcStr, uint) const; // Unicode string
- virtual EAsiBoolean getValue (CAsiData &) const;
- virtual DBCOLUMNINFO * MapAsiToColumnInfo (DBCOLUMNINFO *) const;
- virtual DBPARAMINFO * MapAsiToParamInfo (DBPARAMINFO *) const;
- // Runtime class iteraction functions
- //
- virtual unsigned long packSize (void) const;
- virtual unsigned long packTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackFrom (CAsiObjPack *);
- virtual unsigned long packValueSize (void) const;
- virtual unsigned long packValueTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackValueFrom (CAsiObjPack *);
- // Duplicate itself
- //
- virtual CAsiObject * duplicate (void) const;
- // Operators
- //
- // Assignment
- CAsiReal &operator= (const CAsiSmallInt &);
- CAsiReal &operator= (const CAsiInt &);
- CAsiReal &operator= (const CAsiNumeric &);
- CAsiReal &operator= (const CAsiDecimal &);
- CAsiReal &operator= (const CAsiFloat &);
- CAsiReal &operator= (const CAsiReal &);
- CAsiReal &operator= (const CAsiDouble &);
- CAsiReal &operator= (const smallint);
- CAsiReal &operator= (const integer);
- CAsiReal &operator= (const real);
- CAsiReal &operator= (const int);
- // Arithmetic operators
- CAsiReal &operator+= (const CAsiSmallInt &);
- CAsiReal &operator+= (const CAsiInt &);
- CAsiReal &operator+= (const CAsiNumeric &);
- CAsiReal &operator+= (const CAsiDecimal &);
- CAsiReal &operator+= (const CAsiFloat &);
- CAsiReal &operator+= (const CAsiReal &);
- CAsiReal &operator+= (const CAsiDouble &);
- CAsiReal &operator+= (const smallint);
- CAsiReal &operator+= (const integer);
- CAsiReal &operator+= (const real);
- CAsiReal &operator+= (const int);
- CAsiReal &operator-= (const CAsiSmallInt &);
- CAsiReal &operator-= (const CAsiInt &);
- CAsiReal &operator-= (const CAsiNumeric &);
- CAsiReal &operator-= (const CAsiDecimal &);
- CAsiReal &operator-= (const CAsiFloat &);
- CAsiReal &operator-= (const CAsiReal &);
- CAsiReal &operator-= (const CAsiDouble &);
- CAsiReal &operator-= (const smallint);
- CAsiReal &operator-= (const integer);
- CAsiReal &operator-= (const real);
- CAsiReal &operator-= (const int);
- CAsiReal &operator*= (const CAsiSmallInt &);
- CAsiReal &operator*= (const CAsiInt &);
- CAsiReal &operator*= (const CAsiNumeric &);
- CAsiReal &operator*= (const CAsiDecimal &);
- CAsiReal &operator*= (const CAsiFloat &);
- CAsiReal &operator*= (const CAsiReal &);
- CAsiReal &operator*= (const CAsiDouble &);
- CAsiReal &operator*= (const smallint);
- CAsiReal &operator*= (const integer);
- CAsiReal &operator*= (const real);
- CAsiReal &operator*= (const int);
- CAsiReal &operator/= (const CAsiSmallInt &);
- CAsiReal &operator/= (const CAsiInt &);
- CAsiReal &operator/= (const CAsiNumeric &);
- CAsiReal &operator/= (const CAsiDecimal &);
- CAsiReal &operator/= (const CAsiFloat &);
- CAsiReal &operator/= (const CAsiReal &);
- CAsiReal &operator/= (const CAsiDouble &);
- CAsiReal &operator/= (const smallint);
- CAsiReal &operator/= (const integer);
- CAsiReal &operator/= (const real);
- CAsiReal &operator/= (const int);
- CAsiReal operator+ (const CAsiSmallInt &) const;
- CAsiReal operator+ (const CAsiInt &) const;
- CAsiReal operator+ (const CAsiNumeric &) const;
- CAsiReal operator+ (const CAsiDecimal &) const;
- CAsiReal operator+ (const CAsiFloat &) const;
- CAsiReal operator+ (const CAsiReal &) const;
- friend CAsiReal DLLScope operator+ (const CAsiSmallInt &, const CAsiReal &);
- friend CAsiReal DLLScope operator+ (const CAsiInt &, const CAsiReal &);
- friend CAsiReal DLLScope operator+ (const CAsiNumeric &, const CAsiReal &);
- friend CAsiReal DLLScope operator+ (const CAsiDecimal &, const CAsiReal &);
- friend CAsiReal DLLScope operator+ (const CAsiFloat &, const CAsiReal &) ;
- CAsiReal operator+ (const smallint) const;
- CAsiReal operator+ (const integer) const;
- CAsiReal operator+ (const real) const;
- friend CAsiReal DLLScope operator+ (const smallint, const CAsiReal &);
- friend CAsiReal DLLScope operator+ (const integer, const CAsiReal &) ;
- friend CAsiReal DLLScope operator+ (const real, const CAsiReal &) ;
- CAsiReal operator+ (const int) const;
- friend CAsiReal DLLScope operator+ (const int, const CAsiReal &);
- CAsiReal operator- (const CAsiSmallInt &) const;
- CAsiReal operator- (const CAsiInt &) const;
- CAsiReal operator- (const CAsiNumeric &) const;
- CAsiReal operator- (const CAsiDecimal &) const;
- CAsiReal operator- (const CAsiFloat &) const;
- CAsiReal operator- (const CAsiReal &) const;
- friend CAsiReal DLLScope operator- (const CAsiSmallInt &, const CAsiReal &);
- friend CAsiReal DLLScope operator- (const CAsiInt &, const CAsiReal &);
- friend CAsiReal DLLScope operator- (const CAsiNumeric &, const CAsiReal &);
- friend CAsiReal DLLScope operator- (const CAsiDecimal &, const CAsiReal &);
- friend CAsiReal DLLScope operator- (const CAsiFloat &, const CAsiReal &) ;
- CAsiReal operator- (const smallint) const;
- CAsiReal operator- (const integer) const;
- CAsiReal operator- (const real) const;
- friend CAsiReal DLLScope operator- (const smallint, const CAsiReal &);
- friend CAsiReal DLLScope operator- (const integer, const CAsiReal &);
- friend CAsiReal DLLScope operator- (const real, const CAsiReal &);
- CAsiReal operator- (const int) const;
- friend CAsiReal DLLScope operator- (const int, const CAsiReal &);
- CAsiReal operator* (const CAsiSmallInt &) const;
- CAsiReal operator* (const CAsiInt &) const;
- CAsiReal operator* (const CAsiNumeric &) const;
- CAsiReal operator* (const CAsiDecimal &) const;
- CAsiReal operator* (const CAsiFloat &) const;
- CAsiReal operator* (const CAsiReal &) const;
- friend CAsiReal DLLScope operator* (const CAsiSmallInt &, const CAsiReal &);
- friend CAsiReal DLLScope operator* (const CAsiInt &, const CAsiReal &);
- friend CAsiReal DLLScope operator* (const CAsiNumeric &, const CAsiReal &);
- friend CAsiReal DLLScope operator* (const CAsiDecimal &, const CAsiReal &);
- friend CAsiReal DLLScope operator* (const CAsiFloat &, const CAsiReal &) ;
- CAsiReal operator* (const smallint) const;
- CAsiReal operator* (const integer) const;
- CAsiReal operator* (const real) const;
- friend CAsiReal DLLScope operator* (const smallint, const CAsiReal &);
- friend CAsiReal DLLScope operator* (const integer, const CAsiReal &) ;
- friend CAsiReal DLLScope operator* (const real, const CAsiReal &) ;
- CAsiReal operator* (const int) const;
- friend CAsiReal DLLScope operator* (const int, const CAsiReal &);
- CAsiReal operator/ (const CAsiSmallInt &) const;
- CAsiReal operator/ (const CAsiInt &) const;
- CAsiReal operator/ (const CAsiNumeric &) const;
- CAsiReal operator/ (const CAsiDecimal &) const;
- CAsiReal operator/ (const CAsiFloat &) const;
- CAsiReal operator/ (const CAsiReal &) const;
- friend CAsiReal DLLScope operator/ (const CAsiSmallInt &, const CAsiReal &);
- friend CAsiReal DLLScope operator/ (const CAsiInt &, const CAsiReal &);
- friend CAsiReal DLLScope operator/ (const CAsiNumeric &, const CAsiReal &);
- friend CAsiReal DLLScope operator/ (const CAsiDecimal &, const CAsiReal &);
- friend CAsiReal DLLScope operator/ (const CAsiFloat &, const CAsiReal &) ;
- CAsiReal operator/ (const smallint) const;
- CAsiReal operator/ (const integer) const;
- CAsiReal operator/ (const real) const;
- friend CAsiReal DLLScope operator/ (const smallint, const CAsiReal &);
- friend CAsiReal DLLScope operator/ (const integer, const CAsiReal &) ;
- friend CAsiReal DLLScope operator/ (const real, const CAsiReal &);
- CAsiReal operator/ (const int) const;
- friend CAsiReal DLLScope operator/ (const int, const CAsiReal &);
- CAsiReal &operator++ (void);
- CAsiReal &operator-- (void);
- CAsiReal &operator- (void);
- private:
- real rvalue;
- };
- ////////////////////////////////////////////////
- //
- //
- class CAsiDouble: public CAsiApproxNum
- //
- // DOUBLE PRECISION
- //
- {
- public:
- CAsiDouble (void);
- CAsiDouble (const CAsiDouble &);
- virtual ~CAsiDouble (void);
- // Get data descriptor
- //
- virtual EAsiDataType Type (void) const;
- virtual uint ReturnLength (void) const;
- virtual CAsiData * checkAdd (const CAsiData *) const;
- virtual CAsiData * checkSub (const CAsiData *) const;
- virtual CAsiData * checkMul (const CAsiData *) const;
- virtual CAsiData * checkDiv (const CAsiData *) const;
- virtual CAsiData * checkSet (const CAsiData *) const;
- virtual EAsiBoolean isEqualTo (const CAsiData &) const;
- virtual EAsiBoolean isGreaterThan (const CAsiData &) const;
- // Store Data value
- //
- virtual EAsiBoolean storeValue (real);
- virtual EAsiBoolean storeValue (integer);
- virtual EAsiBoolean storeValue (smallint);
- virtual EAsiBoolean storeValue (char *, uint);
- virtual EAsiBoolean storeValue (const CAsiUcStr &);
- virtual EAsiBoolean storeValue (const CAsiData &);
- // ****
- virtual EAsiBoolean storeValue (char *, uint, uint *);
- virtual EAsiBoolean storeValue (const AsiUcStr);
- // Get data value
- //
- virtual integer intValue (void) const;
- virtual real realValue (void) const;
- virtual EAsiBoolean getValue (real *) const;
- virtual EAsiBoolean getValue (integer *) const;
- virtual EAsiBoolean getValue (smallint *) const;
- virtual EAsiBoolean getValue (char *, uint) const;
- virtual EAsiBoolean getValue (CAsiUcStr *) const;
- // ****
- virtual EAsiBoolean getValue (char *, uint, uint *) const; // Binary Buffer
- virtual EAsiBoolean getValue (AsiUcStr, uint) const; // Unicode string
- virtual EAsiBoolean getValue (CAsiData &) const;
- virtual DBCOLUMNINFO * MapAsiToColumnInfo (DBCOLUMNINFO *) const;
- virtual DBPARAMINFO * MapAsiToParamInfo (DBPARAMINFO *) const;
- virtual EAsiBoolean SQLType (CAsiUcStr *) const; // SQL data type as string
- virtual EAsiBoolean SQLLiteral (CAsiUcStr *) const; // SQL compatible literal
- // Runtime class iteraction functions
- //
- virtual unsigned long packSize (void) const;
- virtual unsigned long packTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackFrom (CAsiObjPack *);
- virtual unsigned long packValueSize (void) const;
- virtual unsigned long packValueTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackValueFrom (CAsiObjPack *);
- // Duplicate itself
- //
- virtual CAsiObject *duplicate (void) const;
- // Operators
- //
- // Assignment
- CAsiDouble &operator= (const CAsiSmallInt &);
- CAsiDouble &operator= (const CAsiInt &);
- CAsiDouble &operator= (const CAsiNumeric &);
- CAsiDouble &operator= (const CAsiDecimal &);
- CAsiDouble &operator= (const CAsiFloat &);
- CAsiDouble &operator= (const CAsiReal &);
- CAsiDouble &operator= (const CAsiDouble &);
- CAsiDouble &operator= (const smallint);
- CAsiDouble &operator= (const integer);
- CAsiDouble &operator= (const real);
- CAsiDouble &operator= (const int);
- // Arithmetic operators
- CAsiDouble &operator+= (const CAsiSmallInt &);
- CAsiDouble &operator+= (const CAsiInt &);
- CAsiDouble &operator+= (const CAsiNumeric &);
- CAsiDouble &operator+= (const CAsiDecimal &);
- CAsiDouble &operator+= (const CAsiFloat &);
- CAsiDouble &operator+= (const CAsiReal &);
- CAsiDouble &operator+= (const CAsiDouble &);
- CAsiDouble &operator+= (const smallint);
- CAsiDouble &operator+= (const integer);
- CAsiDouble &operator+= (const real);
- CAsiDouble &operator+= (const int);
- CAsiDouble &operator-= (const CAsiSmallInt &);
- CAsiDouble &operator-= (const CAsiInt &);
- CAsiDouble &operator-= (const CAsiNumeric &);
- CAsiDouble &operator-= (const CAsiDecimal &);
- CAsiDouble &operator-= (const CAsiFloat &);
- CAsiDouble &operator-= (const CAsiReal &);
- CAsiDouble &operator-= (const CAsiDouble &);
- CAsiDouble &operator-= (const smallint);
- CAsiDouble &operator-= (const integer);
- CAsiDouble &operator-= (const real);
- CAsiDouble &operator-= (const int);
- CAsiDouble &operator*= (const CAsiSmallInt &);
- CAsiDouble &operator*= (const CAsiInt &);
- CAsiDouble &operator*= (const CAsiNumeric &);
- CAsiDouble &operator*= (const CAsiDecimal &);
- CAsiDouble &operator*= (const CAsiFloat &);
- CAsiDouble &operator*= (const CAsiReal &);
- CAsiDouble &operator*= (const CAsiDouble &);
- CAsiDouble &operator*= (const smallint);
- CAsiDouble &operator*= (const integer);
- CAsiDouble &operator*= (const real);
- CAsiDouble &operator*= (const int);
- CAsiDouble &operator/= (const CAsiSmallInt &);
- CAsiDouble &operator/= (const CAsiInt &);
- CAsiDouble &operator/= (const CAsiNumeric &);
- CAsiDouble &operator/= (const CAsiDecimal &);
- CAsiDouble &operator/= (const CAsiFloat &);
- CAsiDouble &operator/= (const CAsiReal &);
- CAsiDouble &operator/= (const CAsiDouble &);
- CAsiDouble &operator/= (const smallint);
- CAsiDouble &operator/= (const integer);
- CAsiDouble &operator/= (const real);
- CAsiDouble &operator/= (const int);
- CAsiDouble operator+ (const CAsiSmallInt &) const;
- CAsiDouble operator+ (const CAsiInt &) const;
- CAsiDouble operator+ (const CAsiNumeric &) const;
- CAsiDouble operator+ (const CAsiDecimal &) const;
- CAsiDouble operator+ (const CAsiFloat &) const;
- CAsiDouble operator+ (const CAsiReal &) const;
- CAsiDouble operator+ (const CAsiDouble &) const;
- friend CAsiDouble DLLScope operator+ (const CAsiSmallInt &, const CAsiDouble &);
- friend CAsiDouble DLLScope operator+ (const CAsiInt &, const CAsiDouble &);
- friend CAsiDouble DLLScope operator+ (const CAsiNumeric &, const CAsiDouble &);
- friend CAsiDouble DLLScope operator+ (const CAsiDecimal &, const CAsiDouble &);
- friend CAsiDouble DLLScope operator+ (const CAsiFloat &, const CAsiDouble &);
- friend CAsiDouble DLLScope operator+ (const CAsiReal &, const CAsiDouble &);
- CAsiDouble operator+ (const smallint) const;
- CAsiDouble operator+ (const integer) const;
- CAsiDouble operator+ (const real) const;
- friend CAsiDouble DLLScope operator+ (const smallint, const CAsiDouble &);
- friend CAsiDouble DLLScope operator+ (const integer, const CAsiDouble &) ;
- friend CAsiDouble DLLScope operator+ (const real, const CAsiDouble &) ;
- CAsiDouble operator+ (const int) const;
- friend CAsiDouble DLLScope operator+ (const int, const CAsiDouble &);
- CAsiDouble operator- (const CAsiSmallInt &) const;
- CAsiDouble operator- (const CAsiInt &) const;
- CAsiDouble operator- (const CAsiNumeric &) const;
- CAsiDouble operator- (const CAsiDecimal &) const;
- CAsiDouble operator- (const CAsiFloat &) const;
- CAsiDouble operator- (const CAsiReal &) const;
- CAsiDouble operator- (const CAsiDouble &) const;
- friend CAsiDouble DLLScope operator- (const CAsiSmallInt &, const CAsiDouble &);
- friend CAsiDouble DLLScope operator- (const CAsiInt &, const CAsiDouble &);
- friend CAsiDouble DLLScope operator- (const CAsiNumeric &, const CAsiDouble &);
- friend CAsiDouble DLLScope operator- (const CAsiDecimal &, const CAsiDouble &);
- friend CAsiDouble DLLScope operator- (const CAsiFloat &, const CAsiDouble &) ;
- friend CAsiDouble DLLScope operator- (const CAsiReal &, const CAsiDouble &);
- CAsiDouble operator- (const smallint) const;
- CAsiDouble operator- (const integer) const;
- CAsiDouble operator- (const real) const;
- friend CAsiDouble DLLScope operator- (const smallint, const CAsiDouble &);
- friend CAsiDouble DLLScope operator- (const integer, const CAsiDouble &);
- friend CAsiDouble DLLScope operator- (const real, const CAsiDouble &);
- CAsiDouble operator- (const int) const;
- friend CAsiDouble DLLScope operator- (const int, const CAsiDouble &);
- CAsiDouble operator* (const CAsiSmallInt &) const;
- CAsiDouble operator* (const CAsiInt &) const;
- CAsiDouble operator* (const CAsiNumeric &) const;
- CAsiDouble operator* (const CAsiDecimal &) const;
- CAsiDouble operator* (const CAsiFloat &) const;
- CAsiDouble operator* (const CAsiReal &) const;
- CAsiDouble operator* (const CAsiDouble &) const;
- friend CAsiDouble DLLScope operator* (const CAsiSmallInt &, const CAsiDouble &);
- friend CAsiDouble DLLScope operator* (const CAsiInt &, const CAsiDouble &);
- friend CAsiDouble DLLScope operator* (const CAsiNumeric &, const CAsiDouble &);
- friend CAsiDouble DLLScope operator* (const CAsiDecimal &, const CAsiDouble &);
- friend CAsiDouble DLLScope operator* (const CAsiFloat &, const CAsiDouble &);
- friend CAsiDouble DLLScope operator* (const CAsiReal &, const CAsiDouble &);
- CAsiDouble operator* (const smallint) const;
- CAsiDouble operator* (const integer) const;
- CAsiDouble operator* (const real) const;
- friend CAsiDouble DLLScope operator* (const smallint, const CAsiDouble &);
- friend CAsiDouble DLLScope operator* (const integer, const CAsiDouble &);
- friend CAsiDouble DLLScope operator* (const real, const CAsiDouble &);
- CAsiDouble operator* (const int) const;
- friend CAsiDouble DLLScope operator* (const int, const CAsiDouble &);
- CAsiDouble operator/ (const CAsiSmallInt &) const;
- CAsiDouble operator/ (const CAsiInt &) const;
- CAsiDouble operator/ (const CAsiNumeric &) const;
- CAsiDouble operator/ (const CAsiDecimal &) const;
- CAsiDouble operator/ (const CAsiFloat &) const;
- CAsiDouble operator/ (const CAsiReal &) const;
- CAsiDouble operator/ (const CAsiDouble &) const;
- friend CAsiDouble DLLScope operator/ (const CAsiSmallInt &, const CAsiDouble &);
- friend CAsiDouble DLLScope operator/ (const CAsiInt &, const CAsiDouble &);
- friend CAsiDouble DLLScope operator/ (const CAsiNumeric &, const CAsiDouble &);
- friend CAsiDouble DLLScope operator/ (const CAsiDecimal &, const CAsiDouble &);
- friend CAsiDouble DLLScope operator/ (const CAsiFloat &, const CAsiDouble &);
- friend CAsiDouble DLLScope operator/ (const CAsiReal &, const CAsiDouble &);
- CAsiDouble operator/ (const smallint) const;
- CAsiDouble operator/ (const integer) const;
- CAsiDouble operator/ (const real) const;
- friend CAsiDouble DLLScope operator/ (const smallint, const CAsiDouble &);
- friend CAsiDouble DLLScope operator/ (const integer, const CAsiDouble &);
- friend CAsiDouble DLLScope operator/ (const real, const CAsiDouble &);
- CAsiDouble operator/ (const int) const;
- friend CAsiDouble DLLScope operator/ (const int, const CAsiDouble &);
- CAsiDouble &operator++ (void);
- CAsiDouble &operator-- (void);
- CAsiDouble &operator- (void);
- private:
- real dvalue;
- };
- ////////////////////////////////////////////////
- //
- //
- class CAsiChar: public CAsiData
- //
- // CHARACTER and CHAR VARYING
- //
- {
- friend class CAsiTempTable;
- public:
- // Construction/Destruction
- //
- CAsiChar ();
- CAsiChar (uint);
- CAsiChar (const CAsiChar &);
- virtual ~CAsiChar ();
- // Set Varying, National, Character set name, and Collation
- void setVarying (void);
- void setNational (void);
- void setCharSet (const CAsiUcStr &);
- void setDefCharSet (void);
- void setCollName (const CAsiUcStr &);
- void setCollIdent (AsiUcIdCLT);
- void setCoerc (EAsiCAttr);
- // Get data descriptor
- //
- virtual EAsiDataType Type (void) const;
- virtual uint Length (void) const;
- virtual uint ReturnLength (void) const;
- uint ByteSize (void) const;
- const CAsiUcStr & CollName (void) const;
- const CAsiUcStr & CharSetName (void) const;
- AsiUcIdCLT CollIdent (void) const;
- AsiUcIdCCT CharSetIdent (void) const;
- EAsiCAttr Coercibility (void) const;
- // is_ functions
- //
- virtual EAsiBoolean is_character (void) const;
- virtual EAsiBoolean is_comparable (const CAsiData *) const;
- virtual EAsiBoolean is_storable (const CAsiData *) const;
- virtual EAsiBoolean is_castable (const CAsiData *) const;
- EAsiBoolean is_national (void) const;
- virtual CAsiData * checkCat (const CAsiData *) const;
- virtual CAsiData * checkSet (const CAsiData *) const;
- virtual EAsiBoolean isEqualTo (const CAsiData &) const;
- virtual EAsiBoolean isGreaterThan (const CAsiData &) const;
- // Store Data value
- //
- virtual EAsiBoolean storeValue (real);
- virtual EAsiBoolean storeValue (integer);
- virtual EAsiBoolean storeValue (smallint);
- virtual EAsiBoolean storeValue (char *, uint);
- EAsiBoolean storeValue (char *, uint, AsiUcIdCCT);
- virtual EAsiBoolean storeValue (const CAsiUcStr &);
- virtual EAsiBoolean storeValue (const CAsiData &);
- virtual EAsiBoolean storeValue (const AsiUcStr);
- EAsiBoolean storeValue (GUID *);
- virtual EAsiBoolean storeValue (char *, uint, uint *); // Binary Buffer
- // Get data value
- //
- const CAsiUcStr & charValue (void) const; // Reference to string
- virtual EAsiBoolean getValue (real *) const;
- virtual EAsiBoolean getValue (integer *) const;
- virtual EAsiBoolean getValue (smallint *) const;
- virtual EAsiBoolean getValue (char *, uint) const;
- virtual EAsiBoolean getValue (CAsiUcStr *) const;
- virtual EAsiBoolean getValue (char *, uint, uint *) const; // Binary Buffer
- virtual EAsiBoolean getValue (AsiUcStr, uint) const; // Unicode string
- virtual EAsiBoolean getValue (CAsiData &) const;
- EAsiBoolean getValue (GUID *) const;
- virtual DBCOLUMNINFO * MapAsiToColumnInfo (DBCOLUMNINFO *) const;
- virtual DBPARAMINFO * MapAsiToParamInfo (DBPARAMINFO *) const;
- virtual EAsiBoolean SQLType (CAsiUcStr *) const; // SQL data type as string
- virtual EAsiBoolean SQLLiteral (CAsiUcStr *) const; // SQL compatible literal
- // Runtime class iteraction functions
- //
- virtual unsigned long packSize (void) const;
- virtual unsigned long packTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackFrom (CAsiObjPack *);
- virtual unsigned long packValueSize (void) const;
- virtual unsigned long packValueTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackValueFrom (CAsiObjPack *);
- // Duplicate itself
- //
- virtual CAsiObject * duplicate (void) const;
- // Nullify all members
- virtual void Clear (void);
- // Like predicate and string functions
- //
- EAsiBoolean Like (const CAsiChar &, const CAsiChar &) const;
- CAsiChar Substring (uint) const;
- CAsiChar Substring (uint, uint) const;
- CAsiChar Upper (void) const;
- CAsiChar Lower (void) const;
- CAsiChar Trim (EAsiTrimSpec, const CAsiChar &) const;
- CAsiNumeric Position (const CAsiChar &) const;
- // Operators
- //
- // Assignment
- CAsiChar & operator= (const CAsiChar &);
- CAsiChar & operator= (const CAsiUcStr &);
- // Cancatenation
- CAsiChar operator+ (const CAsiChar &) const;
- CAsiChar operator+ (const CAsiUcStr &) const;
- // Comparision
- int operator> (const CAsiChar &) const;
- int operator> (const CAsiUcStr &) const;
- friend int DLLScope operator> (const CAsiUcStr &, const CAsiChar &);
- int operator>= (const CAsiChar &) const;
- int operator>= (const CAsiUcStr &) const;
- friend int DLLScope operator>= (const CAsiUcStr &, const CAsiChar &);
- int operator== (const CAsiChar &) const;
- int operator== (const CAsiUcStr &) const;
- friend int DLLScope operator== (const CAsiUcStr &, const CAsiChar &);
- int operator<= (const CAsiChar &) const;
- int operator<= (const CAsiUcStr &) const;
- friend int DLLScope operator<= (const CAsiUcStr &, const CAsiChar &);
- int operator< (const CAsiChar &) const;
- int operator< (const CAsiUcStr &) const;
- friend int DLLScope operator< (const CAsiUcStr &, const CAsiChar &);
- int operator!= (const CAsiChar &) const;
- int operator!= (const CAsiUcStr &) const;
- friend int DLLScope operator!= (const CAsiUcStr &, const CAsiChar &);
- private:
- EAsiBoolean isCompColSet(const AsiUcIdCLT, EAsiCAttr) const;
- AsiUcIdCLT CompColSet(const AsiUcIdCLT, EAsiCAttr) const;
- EAsiBoolean isDyadicOpColSet(const AsiUcIdCLT, EAsiCAttr) const;
- AsiUcIdCLT DyadicOpColSet(const AsiUcIdCLT, EAsiCAttr *, EAsiCAttr) const;
- private:
- uint maxlength; // Length of character data
- uint retlength; // Length of the stored data
- CAsiUcStr chvalue; // Value
- short mod; // Type modifiers
- AsiUcIdCCT CharSetId; // Character set identifier
- CAsiUcStr CharSet; // Character set name
- AsiUcIdCLT ColId; // Collation identifier
- CAsiUcStr CName; // Collation name
- EAsiCAttr coercibility; // Coercibility attribute
- };
- ////////////////////////////////////////////////
- //
- //
- class CAsiBinary: public CAsiData
- //
- // BIT and BIT VARYING
- //
- // This class introduces functionality of the BIT and BIT VARYING SQL
- // data type
- // It defines assignment and binary concatenation operations which are
- // associated with = and + operators.
- //
- //
- {
- friend class CAsiTempTable;
- public:
- // Construction/Destruction
- //
- CAsiBinary ();
- CAsiBinary (uint);
- CAsiBinary (const CAsiBinary &);
- virtual ~CAsiBinary ();
- // Set BIT VARYING
- void setVarying (void);
- // Get data descriptor
- //
- virtual EAsiDataType Type (void) const;
- virtual uint Length (void) const; // Binary length
- virtual uint ReturnLength (void) const;
- // is_ functions
- //
- virtual EAsiBoolean is_binary (void) const;
- virtual EAsiBoolean is_comparable (const CAsiData *) const;
- virtual EAsiBoolean is_storable (const CAsiData *) const;
- virtual EAsiBoolean is_castable (const CAsiData *) const;
- virtual CAsiData * checkCat (const CAsiData *) const;
- virtual CAsiData * checkSet (const CAsiData *) const;
- virtual EAsiBoolean isEqualTo (const CAsiData &) const;
- virtual EAsiBoolean isGreaterThan (const CAsiData &) const;
- // Store Data value
- //
- EAsiBoolean storeHexValue (char *, uint, uint *);
- EAsiBoolean storeHexValue (const CAsiUcStr &);
- EAsiBoolean storeBinValue (char *, uint, uint *);
- EAsiBoolean storeBinValue (const CAsiUcStr &);
- virtual EAsiBoolean storeValue (char *, uint);
- virtual EAsiBoolean storeValue (char *, uint, uint *);
- virtual EAsiBoolean storeValue (const CAsiData &);
- // ****
- virtual EAsiBoolean storeValue (real); // Real
- virtual EAsiBoolean storeValue (integer); // Integer
- virtual EAsiBoolean storeValue (smallint); // Smallint
- virtual EAsiBoolean storeValue (const CAsiUcStr &); // Unicode string
- virtual EAsiBoolean storeValue (const AsiUcStr); // Store AsiUcStr
- // Get data value
- //
- EAsiBoolean getHexValue (char *, uint, uint *) const;
- EAsiBoolean getHexValue (CAsiUcStr *) const;
- EAsiBoolean getBinValue (char *, uint, uint *) const;
- EAsiBoolean getBinValue (CAsiUcStr *) const;
- virtual EAsiBoolean getValue (char *, uint) const;
- virtual EAsiBoolean getValue (char *, uint, uint *) const;
- // *****
- virtual EAsiBoolean getValue (real *) const; // Real
- virtual EAsiBoolean getValue (integer *) const; // Integer
- virtual EAsiBoolean getValue (smallint *) const; // Smallint
- virtual EAsiBoolean getValue (CAsiUcStr *) const; // Unicode string
- virtual EAsiBoolean getValue (AsiUcStr, uint) const; // Unicode string
- virtual EAsiBoolean getValue (CAsiData &) const;
- virtual DBCOLUMNINFO *MapAsiToColumnInfo (DBCOLUMNINFO *) const;
- virtual DBPARAMINFO * MapAsiToParamInfo (DBPARAMINFO *) const;
- virtual EAsiBoolean SQLType (CAsiUcStr *) const; // SQL data type as string
- virtual EAsiBoolean SQLLiteral (CAsiUcStr *) const; // SQL compatible literal
- // Runtime class iteraction functions
- //
- virtual unsigned long packSize (void) const;
- virtual unsigned long packTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackFrom (CAsiObjPack *);
- virtual unsigned long packValueSize (void) const;
- virtual unsigned long packValueTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackValueFrom (CAsiObjPack *);
- // Duplicate itself
- //
- virtual CAsiObject *duplicate(void) const;
- // Nullify all members
- virtual void Clear (void);
- // Utility
- //
- CAsiBinary Substring(uint);
- CAsiBinary Substring(uint,uint);
- // Operators
- //
- // Assignment
- CAsiBinary &operator= (const CAsiBinary &);
- // Cancatenation
- CAsiBinary operator+ (const CAsiBinary &) const;
- // Comparision
- int operator> (const CAsiBinary &) const;
- int operator>= (const CAsiBinary &) const;
- int operator== (const CAsiBinary &) const;
- int operator<= (const CAsiBinary &) const;
- int operator< (const CAsiBinary &) const;
- int operator!= (const CAsiBinary &) const;
- private:
- uint blength; // Length of binary data
- uint alength; // Actual length
- uint buflen; // Allocated length
- uchar * value; // Value
- short mod; // Modifier
- };
- /////////////////////////////////////////////////////////////////////////////
- class CAsiIQualifier : public CAsiData
- //
- // Interval Qualifier
- //
- {
- friend class CAsiInterval;
- friend class CAsiDatetime;
- public:
- // Construction/Destruction
- //
- CAsiIQualifier (void);
- CAsiIQualifier (EAsiIType);
- CAsiIQualifier (EAsiIType, uint);
- CAsiIQualifier (EAsiIType, uint, uint);
- CAsiIQualifier (const CAsiIQualifier &);
- virtual ~CAsiIQualifier (void);
- // Set Interval qualifier type and characteristics
- //
- virtual EAsiBoolean setIType (EAsiIType); // Set interval type
- void setLeadFieldPrec (uint); // Set Leading field precision
- void setFracSecPrec (uint); // Set Fractional sec prec
- // Get access to interval characteristics
- //
- virtual EAsiDataType Type (void) const;
- virtual EAsiIType IntervalType (void) const;
- virtual uint LeadFieldPrec (void) const;
- virtual uint FracSecPrec (void) const;
- virtual uint ReturnLength (void) const;
- // Return interval type
- virtual EAsiBoolean is_interval (void) const;
- virtual EAsiBoolean is_yminterval (void) const;
- virtual EAsiBoolean is_dtinterval (void) const;
- virtual EAsiBoolean is_storable (const CAsiData *) const;
- virtual EAsiBoolean is_comparable (const CAsiData *) const;
- EAsiBoolean is_moreaccurate (const CAsiIQualifier *) const;
- virtual EAsiBoolean SQLType (CAsiUcStr *) const; // SQL data type as string
- private:
- virtual EAsiBoolean SQLLiteral (CAsiUcStr *) const; // SQL compatible literal
- public:
- // Assignment operator
- CAsiIQualifier &operator= (const CAsiIQualifier &);
- // Runtime class iteraction functions
- //
- // Duplicate itself
- //
- virtual CAsiObject *duplicate(void) const;
- protected:
- EAsiIType itype; // Interval type
- uint lfp; // Leading field precision
- uint fsp; // Fractional second precision
- };
- ////////////////////////////////////////////////
- //
- //
- class CAsiInterval : public CAsiIQualifier
- //
- // INTERVAL
- //
- // This is a base class for datetime intervals. The basic functionality
- // for class includes setting and retrieving interval sign.
- {
- friend class CAsiDate;
- friend class CAsiTime;
- friend class CAsiTimeStamp;
- public:
- // Constructors/Destructors
- //
- CAsiInterval (void);
- virtual ~CAsiInterval (void);
- virtual EAsiBoolean SQLType (CAsiUcStr *) const;
- virtual CAsiData * checkAdd (const CAsiData *) const;
- virtual CAsiData * checkSub (const CAsiData *) const;
- virtual CAsiData * checkMul (const CAsiData *) const;
- virtual CAsiData * checkDiv (const CAsiData *) const;
- virtual CAsiData * checkSet (const CAsiData *) const;
- // Set/get interval sign
- //
- void setSign (EAsiBoolean);
- EAsiBoolean Sign (void) const;
- protected:
- EAsiBoolean sign; // Interval sign
- };
- ////////////////////////////////////////////////
- //
- //
- class CAsiYM : public CAsiInterval
- //
- // Year Month Intervals
- //
- // Constructors/Destructor
- //
- // CAsiYM ()
- // CAsiYM (
- // EAsiIType itype) // Year Month Interval type
- // CAsiYM (
- // EAsiIType itype, // Year Month Interval type
- // uint lprec // Leading fields precision
- // )
- //
- // Different forms of constructor allow to specify interval type, and leading
- // field precision
- // Interval type shall be a valid Year Month interval type.
- // If invalid interval type was specified, interval will be set to kAsiIUnknown.
- //
- // EAsiBoolean set (
- // EAsiBoolean sign, // Interval sign kAsiFalse (+), kAsiTrue (-)
- // uint years, // Years
- // uint months) // Months
- //
- // EAsiBoolean setYears (
- // uint years) // Years
- //
- // EAsiBoolean setMonths (
- // uint months) // Months
- //
- // Interval fields set functions allow to set interval. They return
- // boolean value, because they must validate input.
- //
- //
- // Get interval fields
- //
- // void get (
- // EAsiBoolean *sign, // Interval sign kAsiFalse (+), kAsiTrue (-)
- // uint *years, // Years
- // uint *months) const // Months
- //
- // EAsiBoolean getYears (
- // uint *years) const // Years
- //
- // EAsiBoolean getMonths (
- // uint *months) const // Months
- //
- // The functions above retrieve interval fields. Return kAsiTrue if
- // specified interval field present in interval and kAsiFalse otherwise.
- //
- //
- // Operators
- //
- // Operators overload interval arithmetics operations like +, -, /, *, and
- // unary minus. Besides them all boolean operators are redefined.
- //
- //
- {
- friend class CAsiDate;
- friend class CAsiTime;
- friend class CAsiTimeStamp;
- friend class CAsiTempTable;
- public:
- // Construction/Destruction
- //
- CAsiYM (void);
- CAsiYM (EAsiIType);
- CAsiYM (EAsiIType, uint);
- CAsiYM (const CAsiYM &);
- virtual ~CAsiYM (void);
- virtual EAsiBoolean setIType (EAsiIType); // Set interval type
- virtual EAsiBoolean is_castable (const CAsiData *) const;
- virtual EAsiBoolean isEqualTo (const CAsiData &) const;
- virtual EAsiBoolean isGreaterThan (const CAsiData &) const;
- // Store Data value
- //
- virtual EAsiBoolean storeValue (integer);
- virtual EAsiBoolean storeValue (smallint);
- virtual EAsiBoolean storeValue (char *, uint);
- virtual EAsiBoolean storeValue (const CAsiUcStr &);
- virtual EAsiBoolean storeValue (const CAsiData &);
- // ******
- virtual EAsiBoolean storeValue (real); // Real
- virtual EAsiBoolean storeValue (char *, uint, uint *); // Binary Buffer
- virtual EAsiBoolean storeValue (const AsiUcStr); // Store AsiUcStr
- // Set data value
- //
- EAsiBoolean set (ASI_IYEAR *);
- EAsiBoolean set (ASI_IYEARTOMONTH *);
- EAsiBoolean set (ASI_IMONTH *);
- EAsiBoolean set (EAsiBoolean, uint, uint);
- EAsiBoolean setYears (uint);
- EAsiBoolean setMonths (uint);
- // Get data value in the Unicode character string format
- //
- virtual EAsiBoolean getValue (integer *) const;
- virtual EAsiBoolean getValue (smallint *) const;
- virtual EAsiBoolean getValue (char *, uint) const;
- virtual EAsiBoolean getValue (CAsiUcStr *) const;
- // ******
- virtual EAsiBoolean getValue (real *) const; // Real
- virtual EAsiBoolean getValue (char *, uint, uint *) const; // Binary Buffer
- virtual EAsiBoolean getValue (AsiUcStr, uint) const; // Unicode string
- virtual EAsiBoolean getValue (CAsiData &) const;
- virtual DBCOLUMNINFO *MapAsiToColumnInfo (DBCOLUMNINFO *) const;
- virtual DBPARAMINFO * MapAsiToParamInfo (DBPARAMINFO *) const;
- virtual EAsiBoolean SQLLiteral (CAsiUcStr *) const; // SQL compatible literal
- EAsiBoolean get (ASI_IYEAR *) const;
- EAsiBoolean get (ASI_IYEARTOMONTH *) const;
- EAsiBoolean get (ASI_IMONTH *) const;
- EAsiBoolean get (EAsiBoolean *, uint *, uint *) const;
- EAsiBoolean getYears (uint *) const;
- EAsiBoolean getMonths (uint *) const;
- // Runtime class iteraction functions
- //
- virtual unsigned long packSize (void) const;
- virtual unsigned long packTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackFrom (CAsiObjPack *);
- virtual unsigned long packValueSize (void) const;
- virtual unsigned long packValueTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackValueFrom (CAsiObjPack *);
- // Duplicate itself
- //
- virtual CAsiObject *duplicate (void) const;
- // Operators
- CAsiYM &operator= (const CAsiYM &);
- CAsiYM &operator= (const CAsiSmallInt &);
- CAsiYM &operator= (const CAsiInt &);
- CAsiYM &operator= (const CAsiNumeric &);
- CAsiYM &operator= (const CAsiDecimal &);
- CAsiYM &operator= (integer);
- CAsiYM operator+ (const CAsiYM &) const;
- friend CAsiDate DLLScope operator+ (const CAsiYM &, const CAsiDate &);
- CAsiYM operator- (const CAsiYM &) const;
- CAsiYM operator* (const CAsiSmallInt &) const;
- CAsiYM operator* (const CAsiInt &) const;
- CAsiYM operator* (const CAsiNumeric &) const;
- CAsiYM operator* (const CAsiDecimal &) const;
- CAsiYM operator* (integer) const;
- friend CAsiYM DLLScope operator* (const CAsiSmallInt &,const CAsiYM &);
- friend CAsiYM DLLScope operator* (const CAsiInt &, const CAsiYM &);
- friend CAsiYM DLLScope operator* (const CAsiNumeric &, const CAsiYM &);
- friend CAsiYM DLLScope operator* (const CAsiDecimal &, const CAsiYM &);
- friend CAsiYM DLLScope operator* (integer, const CAsiYM &);
- CAsiYM operator/ (const CAsiSmallInt &) const;
- CAsiYM operator/ (const CAsiInt &) const;
- CAsiYM operator/ (const CAsiNumeric &) const;
- CAsiYM operator/ (const CAsiDecimal &) const;
- CAsiYM operator/ (integer) const;
- CAsiYM &operator- (void);
- // Comparision predicates
- //
- int operator> (const CAsiYM &) const;
- int operator>= (const CAsiYM &) const;
- int operator== (const CAsiYM &) const;
- int operator<= (const CAsiYM &) const;
- int operator< (const CAsiYM &) const;
- int operator!= (const CAsiYM &) const;
- private:
- char * getYMString (char *, size_t) const;
- protected:
- ulong ivalue; // Interval value in months
- };
- ////////////////////////////////////////////////
- //
- //
- class CAsiDT : public CAsiInterval
- //
- // Day Time Intervals
- //
- // This class introduces functionality of the Day Time intervals.
- //
- // MEMBER FUNCTIONS
- // ----------------
- // Constructors/Destructor
- //
- // CAsiDT ()
- // CAsiDT (
- // EAsiIType itype // Interval type
- // )
- // CAsiDT (
- // EAsiIType itype, // Interval type
- // uint lprec // Leading fields precision
- // )
- // CAsiDT (
- // EAsiIType itype // Interval type
- // uint lprec, // Leading fields precision
- // uint fprec // Fractional second precision
- // )
- // Constructors allow to set interval type, leading field precision and fractional
- // seconds precision
- // Interval type shall specify valid day time interval type.
- // If invalid interval type was specified, interval will be set to kAsiIUnknown.
- //
- //
- // EAsiBoolean set (
- // EAsiBoolean sign, // Interval sign kAsiFalse (+), kAsiTrue (-)
- // uint days, // Days
- // uint hours, // Hours
- // uint minutes, // Minutes
- // double seconds) // Seconds
- //
- // EAsiBoolean setDays (
- // uint days) // Days
- //
- // EAsiBoolean setHours (
- // uint hours) // Hours
- //
- // EAsiBoolean setMinutes (
- // uint minutes) // Minutes
- //
- // EAsiBoolean getSeconds (
- // double seconds) // Seconds
- //
- // Interval fields set functions allow to set interval. They return
- // boolean value, because they must validate input.
- //
- //
- // Get interval fields
- //
- // void get (
- // EAsiBoolean *sign, // Interval sign kAsiFalse (+), kAsiTrue (-)
- // uint *days, // Days
- // uint *hours, // Hours
- // uint *minutes, // Minutes
- // double *seconds) const // Seconds with fraction
- //
- // EAsiBoolean getDays (
- // uint *days // Days
- // ) const
- //
- // EAsiBoolean getHours (
- // uint *hours // Hours
- // ) const;
- //
- // EAsiBoolean getMinutes (
- // uint *minutes // Minutes
- // ) const;
- //
- // EAsiBoolean getSeconds (
- // double *seconds) const; // Seconds with fraction
- //
- // The functions above retrieve interval fields
- //
- //
- // Operators
- //
- // Operators overload interval arithmetics operations like +, -, /, *, and
- // unary minus. Besides them all boolean operators are redefined.
- //
- //
- {
- // Friend classes
- friend class CAsiDate;
- friend class CAsiTime;
- friend class CAsiTimeStamp;
- friend class CAsiTempTable;
- private:
- // private helpers
- void ChkMul (real);
- void ChkDiv (real);
- int cmpDTI (const CAsiDT&) const;
- EAsiBoolean ChkSet (double);
- void ChkSet2 (double);
- double LocalToUTC (double) const;
- double UTCToLocal (double) const;
- public:
- // Constructors/Destructors
- //
- CAsiDT (void);
- CAsiDT (EAsiIType);
- CAsiDT (EAsiIType, uint);
- CAsiDT (EAsiIType, uint, uint);
- CAsiDT (const CAsiDT &);
- virtual ~CAsiDT (void);
- virtual EAsiBoolean setIType (EAsiIType); // Set interval type
- virtual EAsiBoolean is_castable (const CAsiData *) const;
- virtual EAsiBoolean isEqualTo (const CAsiData &) const;
- virtual EAsiBoolean isGreaterThan (const CAsiData &) const;
- // Store Data value
- //
- virtual EAsiBoolean storeValue (integer);
- virtual EAsiBoolean storeValue (smallint);
- virtual EAsiBoolean storeValue (char *, uint);
- virtual EAsiBoolean storeValue (const CAsiUcStr &);
- virtual EAsiBoolean storeValue (const CAsiData &);
- // ******
- virtual EAsiBoolean storeValue (real); // Real
- virtual EAsiBoolean storeValue (char *, uint, uint *); // Binary Buffer
- virtual EAsiBoolean storeValue (const AsiUcStr); // Store AsiUcStr
- // Set data value
- //
- EAsiBoolean set (ASI_IDAY *);
- EAsiBoolean set (ASI_IHOUR *);
- EAsiBoolean set (ASI_IMINUTE *);
- EAsiBoolean set (ASI_ISECOND *);
- EAsiBoolean set (ASI_IDAYTOHOUR *);
- EAsiBoolean set (ASI_IDAYTOMINUTE *);
- EAsiBoolean set (ASI_IDAYTOSECOND *);
- EAsiBoolean set (ASI_IHOURTOMINUTE *);
- EAsiBoolean set (ASI_IHOURTOSECOND *);
- EAsiBoolean set (ASI_IMINUTETOSECOND *);
- EAsiBoolean set (EAsiBoolean, uint, uint, uint, double);
- EAsiBoolean setDays (uint);
- EAsiBoolean setHours (uint);
- EAsiBoolean setMinutes (uint);
- EAsiBoolean setSeconds (double);
- // Get data value in the Unicode character string format
- //
- virtual EAsiBoolean getValue (integer *) const;
- virtual EAsiBoolean getValue (smallint *) const;
- virtual EAsiBoolean getValue (char *, uint) const;
- virtual EAsiBoolean getValue (CAsiUcStr *) const;
- // ******
- virtual EAsiBoolean getValue (real *) const; // Real
- virtual EAsiBoolean getValue (char *, uint, uint *) const; // Binary Buffer
- virtual EAsiBoolean getValue (AsiUcStr, uint) const; // Unicode string
- virtual EAsiBoolean getValue (CAsiData &) const;
- virtual DBCOLUMNINFO *MapAsiToColumnInfo (DBCOLUMNINFO *) const;
- virtual DBPARAMINFO * MapAsiToParamInfo (DBPARAMINFO *) const;
- virtual EAsiBoolean SQLLiteral (CAsiUcStr *) const; // SQL compatible literal
- EAsiBoolean get (ASI_IDAY *) const;
- EAsiBoolean get (ASI_IHOUR *) const;
- EAsiBoolean get (ASI_IMINUTE *) const;
- EAsiBoolean get (ASI_ISECOND *) const;
- EAsiBoolean get (ASI_IDAYTOHOUR *) const;
- EAsiBoolean get (ASI_IDAYTOMINUTE *) const;
- EAsiBoolean get (ASI_IDAYTOSECOND *) const;
- EAsiBoolean get (ASI_IHOURTOMINUTE *) const;
- EAsiBoolean get (ASI_IHOURTOSECOND *) const;
- EAsiBoolean get (ASI_IMINUTETOSECOND *) const;
- EAsiBoolean get (EAsiBoolean *, uint *, uint *, uint *,
- double *) const;
- EAsiBoolean getDays (uint *) const;
- EAsiBoolean getHours (uint *) const;
- EAsiBoolean getMinutes (uint *) const;
- EAsiBoolean getSeconds (double *) const;
- // Runtime class iteraction functions
- //
- virtual unsigned long packSize (void) const;
- virtual unsigned long packTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackFrom (CAsiObjPack *);
- virtual unsigned long packValueSize (void) const;
- virtual unsigned long packValueTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackValueFrom (CAsiObjPack *);
- // Duplicate itself
- //
- virtual CAsiObject *duplicate (void) const;
- // Operators
- CAsiDT &operator= (const CAsiDT &);
- CAsiDT &operator= (const CAsiSmallInt &);
- CAsiDT &operator= (const CAsiInt &);
- CAsiDT &operator= (const CAsiNumeric &);
- CAsiDT &operator= (const CAsiDecimal &);
- CAsiDT &operator= (integer);
- CAsiDT operator+ (const CAsiDT &) const;
- CAsiDT operator- (const CAsiDT &) const;
- CAsiDT operator* (const CAsiSmallInt &) const;
- CAsiDT operator* (const CAsiInt &) const;
- CAsiDT operator* (const CAsiNumeric &) const;
- CAsiDT operator* (const CAsiDecimal &) const;
- CAsiDT operator* (integer) const;
- friend CAsiDT DLLScope operator* (const CAsiSmallInt &,const CAsiDT &);
- friend CAsiDT DLLScope operator* (const CAsiInt &, const CAsiDT &);
- friend CAsiDT DLLScope operator* (const CAsiNumeric &, const CAsiDT &);
- friend CAsiDT DLLScope operator* (const CAsiDecimal &, const CAsiDT &);
- friend CAsiDT DLLScope operator* (integer, const CAsiDT &);
- CAsiDT operator/ (const CAsiSmallInt &) const;
- CAsiDT operator/ (const CAsiInt &) const;
- CAsiDT operator/ (const CAsiNumeric &) const;
- CAsiDT operator/ (const CAsiDecimal &) const;
- CAsiDT operator/ (integer) const;
- CAsiDT &operator- (void);
- // Comparision predicates
- //
- int operator> (const CAsiDT &) const;
- int operator>= (const CAsiDT &) const;
- int operator== (const CAsiDT &) const;
- int operator<= (const CAsiDT &) const;
- int operator< (const CAsiDT &) const;
- int operator!= (const CAsiDT &) const;
- private:
- char * getDTString (char * , size_t) const;
- protected:
- double ivalue; // Interval value in seconds with fraction
- };
- ////////////////////////////////////////////////
- //
- //
- class CAsiDatetime : public CAsiData
- //
- // Datetime
- //
- {
- public:
- // Construction/Destruction
- //
- CAsiDatetime ();
- virtual ~CAsiDatetime ();
- // Get data descriptor
- //
- virtual EAsiDataType Type (void) const;
- // is_ functions
- //
- virtual EAsiBoolean is_datetime (void) const;
- virtual EAsiBoolean is_comparable (const CAsiData *) const;
- virtual CAsiData * checkAdd (const CAsiData *) const;
- virtual CAsiData * checkSub (const CAsiData *) const;
- virtual CAsiData * checkSet (const CAsiData *) const;
- // Get datetime field value
- //
- virtual ushort Year (void) const = 0;
- virtual ushort Month (void) const = 0;
- virtual ushort Day (void) const = 0;
- virtual ushort Hour (void) const = 0;
- virtual ushort Minute (void) const = 0;
- virtual double Second (void) const = 0;
- protected:
- };
- ////////////////////////////////////////////////
- //
- //
- class CAsiDate: public CAsiDatetime
- //
- // DATE
- //
- {
- friend class CAsiTimeStamp;
- friend class CAsiTempTable;
- public:
- // Construction/Destruction
- //
- CAsiDate ();
- CAsiDate (const CAsiDate &);
- virtual ~CAsiDate (void);
- // Get data descriptor
- //
- virtual EAsiDTType DateTimeType (void) const;
- virtual uint ReturnLength (void) const;
- // Check storable
- virtual EAsiBoolean is_storable (const CAsiData *) const;
- virtual EAsiBoolean is_castable (const CAsiData *) const;
- virtual EAsiBoolean isEqualTo (const CAsiData &) const;
- virtual EAsiBoolean isGreaterThan (const CAsiData &) const;
- // Store Data value
- //
- virtual EAsiBoolean storeValue (char *, uint);
- virtual EAsiBoolean storeValue (const CAsiUcStr &);
- virtual EAsiBoolean storeValue (const CAsiData &);
- virtual EAsiBoolean storeValue (const DBDATE *);
- virtual EAsiBoolean storeValue (DATE);
- // *******
- // virtual EAsiBoolean storeValue (real); // Real == DATE
- virtual EAsiBoolean storeValue (integer); // Integer
- virtual EAsiBoolean storeValue (smallint); // Smallint
- virtual EAsiBoolean storeValue (char *, uint, uint *); // Binary Buffer
- virtual EAsiBoolean storeValue (const AsiUcStr); // Store AsiUcStr
- // Set date fields
- //
- EAsiBoolean set (ASI_DTDATE *);
- EAsiBoolean set (const DBDATE *);
- EAsiBoolean set (ushort, ushort, ushort);
- EAsiBoolean setYear (ushort);
- EAsiBoolean setMonth (ushort);
- EAsiBoolean setDay (ushort);
- // Get data value
- //
- EAsiBoolean get (ASI_DTDATE *) const;
- EAsiBoolean get (DBDATE *) const;
- virtual EAsiBoolean getValue (char *, uint) const;
- virtual EAsiBoolean getValue (CAsiUcStr *) const;
- virtual EAsiBoolean getValue (DBDATE *) const; // OLE DB date
- virtual EAsiBoolean getValue (DATE *) const; // OLE DB "double" date
- // *****
- // virtual EAsiBoolean getValue (real *) const; // Real == DATE
- virtual EAsiBoolean getValue (integer *) const; // Integer
- virtual EAsiBoolean getValue (smallint *) const; // Smallint
- virtual EAsiBoolean getValue (char *, uint, uint *) const; // Binary Buffer
- virtual EAsiBoolean getValue (AsiUcStr, uint) const; // Unicode string
- virtual EAsiBoolean getValue (CAsiData &) const;
- virtual DBCOLUMNINFO *MapAsiToColumnInfo (DBCOLUMNINFO *) const;
- virtual DBPARAMINFO * MapAsiToParamInfo (DBPARAMINFO *) const;
- virtual EAsiBoolean SQLType (CAsiUcStr *) const; // SQL data type as string
- virtual EAsiBoolean SQLLiteral (CAsiUcStr *) const; // SQL compatible literal
- virtual ushort Year (void) const;
- virtual ushort Month (void) const;
- virtual ushort Day (void) const;
- virtual ushort Hour (void) const;
- virtual ushort Minute (void) const;
- virtual double Second (void) const;
- // Runtime class iteraction functions
- //
- virtual unsigned long packSize (void) const;
- virtual unsigned long packTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackFrom (CAsiObjPack *);
- virtual unsigned long packValueSize (void) const;
- virtual unsigned long packValueTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackValueFrom (CAsiObjPack *);
- // Duplicate itself
- //
- virtual CAsiObject *duplicate (void) const;
- // Operators
- //
- // Assignments
- CAsiDate &operator= (const CAsiDate &);
- // Arithmatics
- CAsiDate operator+ (const CAsiYM &) const;
- CAsiDate operator+ (const CAsiDT &) const;
- friend CAsiDate DLLScope operator+ (const CAsiYM &, const CAsiDate &);
- friend CAsiDate DLLScope operator+ (const CAsiDT &, const CAsiDate &);
- CAsiDate operator- (const CAsiYM &) const;
- CAsiDate operator- (const CAsiDT &) const;
- // Dates difference , result corresponds with EAsiType value
- CAsiYM YMDiff (const CAsiDate &, const CAsiYM &) const;
- CAsiDT DTDiff (const CAsiDate &, const CAsiDT &) const;
- // Comparision
- int operator> (const CAsiDate &) const;
- int operator>= (const CAsiDate &) const;
- int operator== (const CAsiDate &) const;
- int operator<= (const CAsiDate &) const;
- int operator< (const CAsiDate &) const;
- int operator!= (const CAsiDate &) const;
- protected:
- ulong month; // Months since 00-00-00
- ushort day; // Day of the month
- };
- ///////////////////////////////////////////
- //
- //
- class CAsiTime : public CAsiDatetime
- //
- // TIME and TIME WITH TIME ZONE
- //
- {
- friend class CAsiTimeStamp;
- friend class CAsiTempTable;
- public:
- // Construction/Destruction
- //
- CAsiTime (void);
- CAsiTime (const CAsiDT&);
- CAsiTime (uint);
- CAsiTime (uint, const CAsiDT&);
- CAsiTime (const CAsiTime &);
- virtual ~CAsiTime (void);
- void setWithTimeZone (EAsiBoolean f = kAsiTrue );
- // Get data descriptor
- //
- virtual EAsiDTType DateTimeType (void) const;
- virtual uint TimePrec (void) const;
- virtual uint ReturnLength (void) const;
- // Check storable
- virtual EAsiBoolean is_storable (const CAsiData *) const;
- virtual EAsiBoolean is_castable (const CAsiData *) const;
- virtual EAsiBoolean isEqualTo (const CAsiData &) const;
- virtual EAsiBoolean isGreaterThan (const CAsiData &) const;
- // Store Data value
- //
- virtual EAsiBoolean storeValue (char *, uint);
- virtual EAsiBoolean storeValue (const CAsiUcStr &);
- virtual EAsiBoolean storeValue (const CAsiData &);
- virtual EAsiBoolean storeValue (const DBTIME *);
- // *******
- virtual EAsiBoolean storeValue (real); // Real
- virtual EAsiBoolean storeValue (integer); // Integer
- virtual EAsiBoolean storeValue (smallint); // Smallint
- virtual EAsiBoolean storeValue (char *, uint, uint *); // Binary Buffer
- virtual EAsiBoolean storeValue (const AsiUcStr); // Store AsiUcStr
- // Set date value
- //
- EAsiBoolean set (ASI_DTTIME *);
- EAsiBoolean set (const DBTIME *);
- EAsiBoolean set (ushort, ushort, double);
- EAsiBoolean setHour (ushort);
- EAsiBoolean setMinute (ushort);
- EAsiBoolean setSecond (double);
- EAsiBoolean setTimeZone (const CAsiDT &);
- // Get data value
- //
- EAsiBoolean get (ASI_DTTIME *) const;
- EAsiBoolean get (DBTIME *) const;
- virtual EAsiBoolean getValue (char *, uint) const;
- virtual EAsiBoolean getValue (CAsiUcStr *) const;
- virtual EAsiBoolean getValue (DBTIME *) const; // OLE DB time
- // *****
- virtual EAsiBoolean getValue (real *) const; // Real
- virtual EAsiBoolean getValue (integer *) const; // Integer
- virtual EAsiBoolean getValue (smallint *) const; // Smallint
- virtual EAsiBoolean getValue (char *, uint, uint *) const; // Binary Buffer
- virtual EAsiBoolean getValue (AsiUcStr, uint) const; // Unicode string
- virtual EAsiBoolean getValue (CAsiData &) const;
- virtual DBCOLUMNINFO *MapAsiToColumnInfo (DBCOLUMNINFO *) const;
- virtual DBPARAMINFO * MapAsiToParamInfo (DBPARAMINFO *) const;
- virtual EAsiBoolean SQLType (CAsiUcStr *) const; // SQL data type as string
- virtual EAsiBoolean SQLLiteral (CAsiUcStr *) const; // SQL compatible literal
- virtual ushort Year (void) const {return 0;};
- virtual ushort Month (void) const {return 0;};
- virtual ushort Day (void) const {return 0;};
- virtual ushort Hour (void) const;
- virtual ushort Minute (void) const;
- virtual double Second (void) const;
- const CAsiDT &TimeZone (void) const;
- // Runtime class iteraction functions
- //
- virtual unsigned long packSize (void) const;
- virtual unsigned long packTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackFrom (CAsiObjPack *);
- virtual unsigned long packValueSize (void) const;
- virtual unsigned long packValueTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackValueFrom (CAsiObjPack *);
- // Duplicate itself
- //
- virtual CAsiObject *duplicate (void) const;
- // Operators
- //
- // Assignments
- CAsiTime &operator= (const CAsiTime &);
- // Arithmatics
- CAsiTime operator+ (const CAsiDT &) const;
- friend CAsiTime DLLScope operator+ (const CAsiDT &, const CAsiTime &);
- CAsiTime operator- (const CAsiDT &) const;
- // Difference
- CAsiDT DTDiff (const CAsiTime &,const CAsiDT &) const;
- // Comparision
- int operator> (const CAsiTime &) const;
- int operator>= (const CAsiTime &) const;
- int operator== (const CAsiTime &) const;
- int operator<= (const CAsiTime &) const;
- int operator< (const CAsiTime &) const;
- int operator!= (const CAsiTime &) const;
- private:
- ushort timeprec; // Time precision
- double seconds; // Seconds since 0:0 AM with fraction
- short mod; // Modifiyer
- CAsiDT timezone;
- };
- ///////////////////////////////////////////
- //
- //
- class CAsiTimeStamp: public CAsiDatetime
- //
- // TIMESTAMP and TIMESTAMP WITH TIME ZONE
- //
- // This class introduces functionality of the TIMESTAMP SQL data type
- //
- // MEMBER FUNCTIONS
- // ----------------
- // Constructors/Destructor
- //
- // CAsiTimeStamp ()
- // CAsiTimeStamp (
- // uint tprec) // Timestamp precision
- //
- // Two forms of constructor are provided. The second form allows to define
- // timestamp precision. If the first form of constructor
- // is used, timestamp precision is set to 0.
- //
- //
- // Set Timestamp fields
- //
- // EAsiBoolean set (
- // ushort year, // Year
- // ushort month, // Month
- // ushort day, // Day
- // ushort hour, // Hour
- // ushort minute, // Minute
- // double second) // Second with fraction
- //
- // EAsiBoolean setYear (
- // ushort year) // Year
- //
- // EAsiBoolean setMonth (
- // ushort month) // Month
- //
- // EAsiBoolean setDay (
- // ushort day) // Day
- //
- // EAsiBoolean setHour (
- // ushort hour) // Hour
- //
- // EAsiBoolean setMinute (
- // ushort minute) // Minute
- //
- // EAsiBoolean setSecond (
- // double second) // Second with fraction
- //
- // These fiunctions are used to set datetime type and datetime fields.
- //
- // Year shall be greater or equal than 0;
- // Month >= 1 and <= 12;
- // Day >= 1 and <= actual number of days for each month;
- // Hour >= 0 and <= 23
- // Minute >= 0 and <= 59
- // Second >= 0 and <= 59
- // Second fraction is an unsigned short number that holds second fraction.
- //
- // Most of functions return boolean value bacause they must validate
- // input arguments. For example, seconds can't be stored to the DATE or
- // month can be greater than 12.
- //
- //
- // void get (
- // ushort *year, // Year
- // ushort *month, // Month
- // ushort *day, // Day
- // ushort *hour, // Hour
- // ushort *minute, // Minute
- // double *second) // Second with fraction
- //
- // ushort Year ()
- //
- // ushort Month ()
- //
- // ushort Day ()
- //
- // ushort Hour ()
- //
- // ushort Minute ()
- //
- // double Second ()
- //
- // The functions above extracts all or specified datetime fields.
- //
- //
- // Operators
- //
- // All meaningful arithmetic and comparision operators are redefined by
- // this class. Description of them can be found in SQL/ISO standard (6.14).
- // Besides them special datetime operations are defined for the datetime
- // data.
- //
- // CAsiIDateTime & at_time_zone (
- // CAsiDT &tz) // Time zone value
- //
- // This function translate TIME or TIMESTAMP datetime according to the
- // time zone value specified as a internal hour or hour to minute day time
- // interval (see 6.14 SQL/ISO). Interval value shall be between -'12:59 and
- // +'13:00'. If wrong interval type was passed or
- {
- friend class CAsiDate;
- friend class CAsiTime;
- friend class CAsiTempTable;
- public:
- CAsiTimeStamp ();
- CAsiTimeStamp (uint);
- CAsiTimeStamp (const CAsiDT &);
- CAsiTimeStamp (uint, const CAsiDT &);
- CAsiTimeStamp (const CAsiTimeStamp &);
- virtual ~CAsiTimeStamp (void);
- virtual void setNull (void); // Assign NULL
- void setWithTimeZone (EAsiBoolean f = kAsiTrue );
- // Get data descriptor
- //
- virtual EAsiDTType DateTimeType (void) const;
- virtual uint TimeStampPrec (void) const;
- virtual uint ReturnLength (void) const;
- // Check storable
- virtual EAsiBoolean is_storable (const CAsiData *) const;
- virtual EAsiBoolean is_castable (const CAsiData *) const;
- virtual EAsiBoolean isEqualTo (const CAsiData &) const;
- virtual EAsiBoolean isGreaterThan (const CAsiData &) const;
- // Store Data value
- //
- virtual EAsiBoolean storeValue (char *, uint);
- virtual EAsiBoolean storeValue (const CAsiUcStr &);
- virtual EAsiBoolean storeValue (const CAsiData &);
- virtual EAsiBoolean storeValue (const DBTIMESTAMP *);
- // *******
- virtual EAsiBoolean storeValue (real); // Real
- virtual EAsiBoolean storeValue (integer); // Integer
- virtual EAsiBoolean storeValue (smallint); // Smallint
- virtual EAsiBoolean storeValue (char *, uint, uint *); // Binary Buffer
- virtual EAsiBoolean storeValue (const AsiUcStr); // Store AsiUcStr
- // Set timestamp fields
- //
- EAsiBoolean set (ASI_DTTIMESTAMP *);
- EAsiBoolean set (const DBTIMESTAMP *);
- EAsiBoolean set (const CAsiDate &, const CAsiTime &);
- EAsiBoolean set (ushort, ushort, ushort, ushort,
- ushort, double);
- EAsiBoolean setYear (ushort);
- EAsiBoolean setMonth (ushort);
- EAsiBoolean setDay (ushort);
- EAsiBoolean setHour (ushort);
- EAsiBoolean setMinute (ushort);
- EAsiBoolean setSecond (double);
- EAsiBoolean setTimeZone (const CAsiDT &);
- // Get data value
- //
- EAsiBoolean get (ASI_DTTIMESTAMP *) const;
- EAsiBoolean get (DBTIMESTAMP *) const;
- virtual EAsiBoolean getValue (char *, uint) const;
- virtual EAsiBoolean getValue (CAsiUcStr *) const;
- virtual EAsiBoolean getValue (DBTIMESTAMP *) const;
- // *****
- virtual EAsiBoolean getValue (real *) const; // Real
- virtual EAsiBoolean getValue (integer *) const; // Integer
- virtual EAsiBoolean getValue (smallint *) const; // Smallint
- virtual EAsiBoolean getValue (char *, uint, uint *) const; // Binary Buffer
- virtual EAsiBoolean getValue (AsiUcStr, uint) const; // Unicode string
- virtual EAsiBoolean getValue (CAsiData &) const;
- virtual DBCOLUMNINFO *MapAsiToColumnInfo (DBCOLUMNINFO *) const;
- virtual DBPARAMINFO * MapAsiToParamInfo (DBPARAMINFO *) const;
- virtual EAsiBoolean SQLType (CAsiUcStr *) const; // SQL data type as string
- virtual EAsiBoolean SQLLiteral (CAsiUcStr *) const; // SQL compatible literal
- virtual ushort Year (void) const;
- virtual ushort Month (void) const;
- virtual ushort Day (void) const;
- virtual ushort Hour (void) const;
- virtual ushort Minute (void) const;
- virtual double Second (void) const;
- const CAsiDT &TimeZone (void) const;
- // Runtime class iteraction functions
- //
- virtual unsigned long packSize (void) const;
- virtual unsigned long packTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackFrom (CAsiObjPack *);
- virtual unsigned long packValueSize (void) const;
- virtual unsigned long packValueTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackValueFrom (CAsiObjPack *);
- // Duplicate itself
- //
- virtual CAsiObject *duplicate (void) const;
- // Operators
- //
- // Assignments
- CAsiTimeStamp &operator= (const CAsiTimeStamp &);
- CAsiTimeStamp &operator= (const CAsiDate &);
- CAsiTimeStamp &operator= (const CAsiTime &);
- // Arithmatics
- CAsiTimeStamp operator+ (const CAsiYM &) const;
- CAsiTimeStamp operator+ (const CAsiDT &) const;
- friend CAsiTimeStamp DLLScope operator+ (const CAsiYM &, CAsiTimeStamp &);
- friend CAsiTimeStamp DLLScope operator+ (const CAsiDT &, CAsiTimeStamp &);
- CAsiTimeStamp operator- (const CAsiYM &) const;
- CAsiTimeStamp operator- (const CAsiDT &) const;
- // Difference between timestamps
- CAsiYM YMDiff (const CAsiTimeStamp &, const CAsiYM &) const;
- CAsiDT DTDiff (const CAsiTimeStamp &, const CAsiDT &) const;
- // Comparision
- int operator> (const CAsiTimeStamp &) const;
- int operator>= (const CAsiTimeStamp &) const;
- int operator== (const CAsiTimeStamp &) const;
- int operator<= (const CAsiTimeStamp &) const;
- int operator< (const CAsiTimeStamp &) const;
- int operator!= (const CAsiTimeStamp &) const;
- private:
- CAsiTime time;
- CAsiDate date;
- };
- ////////////////////////////////////////////////////////////////////////////////
- // OLEDB BLOBs
- class CAsiBlob : public CAsiData
- {
- public:
- // BLOB types used by ASI
- //
- typedef enum {
- kUnknown = 0,
- kBlob,
- kIPersist,
- kNonIPersist,
- kADT
- } EBlobType;
- // BLOB print format
- //
- typedef enum {
- kUnk = 0,
- kHex,
- kDec,
- kChr,
- kOct,
- kBin
- } EBlobFormat;
- // Construction/Destruction
- //
- CAsiBlob ();
- CAsiBlob (const CAsiBlob &);
- virtual ~CAsiBlob ();
- void SetType (EBlobType);
- EBlobType GetType () const;
- // Get data descriptor
- //
- virtual EAsiDataType Type () const;
- virtual uint Length () const;
- virtual uint ReturnLength () const;
- // Store Data value
- //
- virtual EAsiBoolean storeValue (real);
- virtual EAsiBoolean storeValue (integer);
- virtual EAsiBoolean storeValue (smallint);
- virtual EAsiBoolean storeValue (char *, uint);
- virtual EAsiBoolean storeValue (const CAsiUcStr &);
- virtual EAsiBoolean storeValue (const CAsiData &);
- virtual EAsiBoolean storeValue (char *, uint, uint *);
- EAsiBoolean set (IUnknown *);
- // Retrieve Data value
- //
- virtual EAsiBoolean getValue (real *) const;
- virtual EAsiBoolean getValue (integer *) const;
- virtual EAsiBoolean getValue (smallint *) const;
- virtual EAsiBoolean getValue (char *, uint) const;
- virtual EAsiBoolean getValue (CAsiUcStr *) const;
- virtual EAsiBoolean getValue (CAsiData &) const;
- EAsiBoolean get (IUnknown **);
- virtual DBCOLUMNINFO * MapAsiToColumnInfo (DBCOLUMNINFO *) const;
- virtual DBPARAMINFO * MapAsiToParamInfo (DBPARAMINFO *) const;
- virtual EAsiBoolean SQLType (CAsiUcStr *) const; // SQL data type as string
- virtual EAsiBoolean SQLLiteral (CAsiUcStr *) const; // SQL compatible literal
- // Runtime class iteraction functions
- //
- virtual unsigned long packSize (void) const;
- virtual unsigned long packTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackFrom (CAsiObjPack *);
- virtual unsigned long packValueSize () const;
- virtual unsigned long packValueTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackValueFrom (CAsiObjPack *);
- // Duplicate itself
- //
- virtual CAsiObject * duplicate () const;
- // Nullify all members
- //
- virtual void Clear ();
- // Mostly useful interface
- //
- HRESULT Read (void *, ulong, ulong *);
- HRESULT Write (void *, ulong, ulong *);
- // ConvertToString functions
- //
- void SetFormat (EBlobFormat);
- void SetPrintLen (int);
- HRESULT ReadHead ();
- private:
- IUnknown * m_pIUnknown; // OLEDB interface to support I/O
- EBlobType m_eBlobType;
- EBlobFormat m_eBlobFormat;
- int m_iHeadLen;
- char m_cBlobHead[MaxCharLength];
- };
- ///////////////////////////////////////////////////////////////////////////////////////////
- //
- // class CAsiColumn
- //
- ///////////////////////////////////////////////////////////////////////////////////////////
- class CAsiColumn : public CAsiObject
- // This class introduces functionality of a table column. It holds a
- // column descriptor and column data. Column descriptor includes the
- // folowing issues, that can be set and retrieved by the CAsiColumn services:
- //
- // - Column name;
- // - Whether column name is an implementation defined;
- // - Domain, if column is based on it;
- // - Data type descriptor ;
- // - Collation name, if any;
- // - Value of the default option
- // - Nullability characteristics
- // - Ordinal position of column within table
- //
- //
- {
- public:
- CAsiColumn (void);
- CAsiColumn (const CAsiIdent &);
- CAsiColumn (const CAsiIdent &, const CAsiSmallInt &);
- CAsiColumn (const CAsiIdent &, const CAsiInt &);
- CAsiColumn (const CAsiIdent &, const CAsiNumeric &);
- CAsiColumn (const CAsiIdent &, const CAsiDecimal &);
- CAsiColumn (const CAsiIdent &, const CAsiFloat &);
- CAsiColumn (const CAsiIdent &, const CAsiReal &);
- CAsiColumn (const CAsiIdent &, const CAsiDouble &);
- CAsiColumn (const CAsiIdent &, const CAsiChar &);
- CAsiColumn (const CAsiIdent &, const CAsiBinary &);
- CAsiColumn (const CAsiIdent &, const CAsiDate &);
- CAsiColumn (const CAsiIdent &, const CAsiTime &);
- CAsiColumn (const CAsiIdent &, const CAsiTimeStamp &);
- CAsiColumn (const CAsiIdent &, const CAsiYM &);
- CAsiColumn (const CAsiIdent &, const CAsiDT &);
- CAsiColumn (const CAsiIdent &, const CAsiIdent &); // By domain name
- CAsiColumn (const CAsiIdent &, CAsiData *); // By generic data
- CAsiColumn (const CAsiColumn &); // copy constructor
- CAsiColumn (const DBCOLUMNINFO *);
- virtual ~CAsiColumn ();
-
- // Setting Column Descriptor
- //
- void setName (const CAsiIdent &); // Set column name
- void setNullable (EAsiBoolean); // Set nullability
- void setNative (EAsiBoolean); // Set native flag
- void setCollation (const CAsiUcStr &); // Set collation name
- void setDefault (CAsiData *); // Set Default data
- void setDomain (const CAsiIdent &); // Set Domain name
- void setDataDsc (CAsiData *); // Set data descriptor
- void setOffset (uint); // Set Ordinal position
- // Read Column Descriptor
- //
- const CAsiIdent & Name (void) const; // Get column name
- EAsiBoolean Nullable (void) const; // Get nullability
- EAsiBoolean Native (void) const; // Get native flag
- const CAsiUcStr * Collation (void) const; // Get collation name
- CAsiData * Default (void) const; // Get Default data
- const CAsiIdent & Domain (void) const; // Get Domain name
- uint Offset (void) const; // Get Ordinal position
- EAsiBoolean IsBookmark (void) const;
- unsigned long ColumnFlags (void) const; // OLEDB column flags
- const DBCOLUMNINFO & ColumnInfo (void) const;
- // Get Access to Column Data Descriptor and Data
- //
- CAsiData * getData (void) const;
- // Overloaded operators
- CAsiColumn & operator= (const CAsiColumn &);
- CAsiColumn & operator= (CAsiData *);
- // Runtime class iteraction functions
- //
- virtual unsigned long packSize (void) const;
- virtual unsigned long packTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackFrom (CAsiObjPack *);
- virtual unsigned long packValueSize (void) const;
- virtual unsigned long packValueTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackValueFrom (CAsiObjPack *);
- // Duplicate column
- //
- virtual CAsiObject * duplicate (void) const;
- // Release all members
- //
- virtual void Clear (void);
- private:
- static void setColumn (CAsiColumn * t, const CAsiIdent & colname,
- CAsiData * datadsc);
- protected:
- CAsiIdent m_idName; // Column name
- CAsiData * m_pData; // Column data descriptor and data
- EAsiBoolean m_fNullable; // Nullability
- EAsiBoolean m_fNative; // Is native
- CAsiData * m_pDefval; // Default value
- CAsiIdent m_idDomain; // Domain name
- uint m_uiOffset; // Ordinal position
- unsigned long m_dwColFlags; // Column flags (OLEDB column characteristics)
- DBCOLUMNINFO m_sColumnInfo; // Column info
- };
- ////////////////////////////////////////////////
- //
- //
- class CAsiRow : public CAsiObject
- //
- // This class introduces functionality of a column collection
- //
- {
- public:
- CAsiRow (int ColNum);
- CAsiRow (const CAsiRow &);
- virtual ~CAsiRow ();
- int ColNum (void) const;
- CAsiColumn & operator [] (int) const;
- int findCol (const CAsiIdent &) const;
- EAsiBoolean isDistinct (void) const;
- virtual CAsiObject * duplicate (void) const;
- virtual void Clear (void);
- private:
- CAsiColumn * m_pColumns; // Columns data
- int m_iColnum; // Number of columns in row
- };
- ////////////////////////////////////////////////
- //
- //
- class CAsiHostBuffer: public CAsiObject
- //
- // This class holds information about host variable buffer. Host variable
- // buffer has a dual usage in ASI: it is either as a source for dynamic
- // parameters input or a destination for column value output.
- // CAsiHostBuffer is a base class for CAsiParameter class, designating the
- // fact that parameter has to be linked with the host variable buffer.
- //
- // virtual EAsiBoolean setBind (
- // CAsiData *pData // Pointer to host buffer
- // )
- // Bind parameter with data buffer in the host program. Host buffer
- // is represented as a CAsiData object.
- // Function returns kAsiTrue if succeeded and kAsiFalse otherwise.
- //
- //
- //
- // virtual EAsiBoolean getBind (
- // CAsiData **ppData // Storage of pointer to host buffer
- // )
- //
- // This function stores pointer to the host memory buffer into provided
- // memory location.
- // kAsiFalse is returned if parameter was not bound with host buffer, or
- // other abnormal situation occured.
- //
- {
- friend class CAsiCsr;
- friend class CAsiStm;
- public:
- // Construction/descriptor
- //
- CAsiHostBuffer ();
- virtual ~CAsiHostBuffer ();
- // Getting bound variable address
- //
- virtual EAsiBoolean getBind (CAsiData **) const;
- // Runtime class iteraction functions
- //
- protected:
- // Binding parameter with host variable buffer
- //
- virtual EAsiBoolean setBind (CAsiData *);
- protected:
- CAsiData *pData; // Pointer to data
- };
- ////////////////////////////////////////////////
- //
- //
- class CAsiParameter: public CAsiHostBuffer
- //
- // This class describes dynamic parameter or variable reference in the SQL
- // statement and its link with the host program buffer. It inherits
- // functionality of the CAsiHostBuffer supercalss and reloads setBind()
- // member function.
- //
- // EAsiBoolean setBind (
- // CAsiData *pData, // Pointer to host buffer
- // )
- //
- // Bind parameter with the host program buffer. Function also checks
- // whether the host variable type matches the parameter type. Return
- // kAsiTrue if succeded, and kAsiFalse otherwise. Can set and push
- // complition in DDA if types mismatch error was detected.
- //
- {
- // Friend classes
- //
- friend class CAsiParser;
- friend class CAsiStm;
- friend class CAsiDDAParams;
- friend class CAsiHostLink;
- friend class CAsiInterDBCursor;
- friend class CAsiEmulCursor;
- friend class CAsiEmulTable;
- public:
- CAsiParameter ();
- CAsiParameter (const DBPARAMINFO *);
- virtual ~CAsiParameter ();
- protected:
- // Bind parameter with host buffer
- //
- virtual EAsiBoolean setBind (CAsiData *);
- public:
- // Setting parameter characteristics
- //
- void setName (const CAsiIdent &); // name
- void setNullable (EAsiBoolean); // nullability characteristics
- void setDsc (CAsiData*); // data descriptor
- // Getting parameter characteristics
- //
- const CAsiIdent & Name (void) const; // name
- EAsiBoolean isNullable (void) const; // nullability characteristics
- CAsiData * Dsc (void) const; // data descriptor
- // Runtime class iteraction functions
- //
- virtual unsigned long packSize (void) const;
- virtual unsigned long packTo (CAsiObjPack *) const;
- virtual EAsiBoolean unpackFrom (CAsiObjPack *);
- private:
- virtual CAsiObject * duplicate (void) const;
- // Nullify all members
- virtual void Clear (void);
- private:
- CAsiIdent ucParName; // Parameter name
- CAsiData * pDataDescriptor; // Parameter data descriptor
- EAsiBoolean eNul; // Nullability characteristics
- };
- /////////////////////////////////////////////////////////////////////////////
- struct ListItem {
- struct ListItem *next;
- CAsiObject *item;
- };
- typedef ULONG_PTR ASILISTPOS; // List position
- /////////////////////////////////////////////////////////////////////////////
- //
- // class CAsiList
- //
- /////////////////////////////////////////////////////////////////////////////
- class CAsiList: public CAsiObject
- {
- public:
- // Construction destruction
- CAsiList ();
- virtual ~ CAsiList ();
- // Add item
- //
- EAsiBoolean addFirst (CAsiObject *); // Add First
- EAsiBoolean addLast (CAsiObject *); // Add Last
- // Delete items
- EAsiBoolean del (CAsiObject *); // Delete
- EAsiBoolean del (int); // Delete by number
- EAsiBoolean detach (CAsiObject *); // Detach object
- EAsiBoolean detach (int); // Detach by number
- EAsiBoolean delFirst (void); // Delete First
- EAsiBoolean delLast (void); // Delete Last
- EAsiBoolean delTail (int); // Delete tail
- EAsiBoolean detachFirst (void); // Detach First
- EAsiBoolean detachLast (void); // Detach Last
- EAsiBoolean detachTail (int); // Detach tail
- // Replace item
- EAsiBoolean replace (int, // Replace object.
- CAsiObject *); // Delete the old one
- EAsiBoolean overwrite (int, // Overwrite object.
- CAsiObject *); // Don't delete the old one
- // Manipulate list
- //
- CAsiObject * first (void); // first item
- CAsiObject * next (void); // Next item
- CAsiObject * next (ASILISTPOS); // Next item after position
- CAsiObject * last (void); // Last item
- int qnty (void) const; // number of items
- void detachAll (void); // Clear list
- ASILISTPOS position (void) const; // Get current position
- CAsiObject * getCurrent (void) const; // Get current
- CAsiObject * getAt (ASILISTPOS) const; // Get at position
- // Operator []
- CAsiObject *operator [] (int); // i-th item
- // Duplicate node
- virtual CAsiObject *duplicate () const;
- virtual void Clear (void); // Clear list
- private:
- struct ListItem *head;
- struct ListItem *tail;
- struct ListItem *current;
- };
- ////////////////////////////////////////////////////////////////////////
- //
- // class CAsiIRow
- //
- ////////////////////////////////////////////////////////////////////////
- class CAsiIRow : public CAsiObject
- //
- // This class represents an array of pointers to the CAsiData objects
- //
- {
- public:
- CAsiIRow (void);
- CAsiIRow (const int);
- CAsiIRow (const CAsiIRow &);
- virtual ~CAsiIRow (void);
- int Quantity (void) const; // Number of items
- EAsiBoolean setItem (int, CAsiData *); // Initialize item
- // Operators
- //
- CAsiData * operator [] (const int item) const;
- // Misceleneous
- //
- virtual CAsiObject * duplicate (void) const;
- virtual void Clear (void);
- private:
- CAsiData **values; // Data
- int items; // Number of items in internal row
- };
- #pragma pack (pop)
- #endif /* ASI_SDATA_HH */
|