//// PGTSColumnDescription.m// BaseTen//// Copyright (C) 2006-2009 Marko Karppinen & Co. LLC.//// Before using this software, please review the available licensing options// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting// us at sales@karppinen.fi. Without an additional license, this software// may be distributed only in compliance with the GNU General Public License.////// This program is free software; you can redistribute it and/or modify// it under the terms of the GNU General Public License, version 2.0,// as published by the Free Software Foundation.//// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the// GNU General Public License for more details.//// You should have received a copy of the GNU General Public License// along with this program; if not, write to the Free Software// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA//// $Id$//#import "PGTSColumnDescription.h"#import "NSString+PGTSAdditions.h"#import "BXLogger.h"/** * \internal * \brief Table field. */@implementationPGTSColumnDescription-(id)init{if((self=[superinit])){mIndex=0;}returnself;}-(void)dealloc{[mDefaultValuerelease];[superdealloc];}-(NSString*)description{return[NSStringstringWithFormat:@"<%@ (%p) %@ (%d)>",[selfclass],self,mName,mIndex];}-(void)setIndex:(NSInteger)anIndex{mIndex=anIndex;}-(NSString*)name{returnmName;}-(NSString*)quotedName:(PGTSConnection*)connection{NSString*retval=nil;if(nil!=mName)retval=[mNamequotedIdentifierForPGTSConnection:connection];returnretval;}-(NSInteger)index{returnmIndex;}-(NSString*)defaultValue{returnmDefaultValue;}-(PGTSTypeDescription*)type{returnmType;}-(NSComparisonResult)indexCompare:(PGTSColumnDescription*)aCol{NSComparisonResultresult=NSOrderedAscending;NSIntegeranIndex=aCol->mIndex;if(mIndex>anIndex)result=NSOrderedDescending;elseif(mIndex==anIndex)result=NSOrderedSame;returnresult;}-(BOOL)isNotNull{returnmIsNotNull;}-(BOOL)isInherited{returnmIsInherited;}-(void)setType:(PGTSTypeDescription*)type{if(mType!=type){[mTyperelease];mType=[typeretain];}}-(void)setNotNull:(BOOL)aBool{mIsNotNull=aBool;}-(void)setInherited:(BOOL)aBool{mIsInherited=aBool;}-(void)setDefaultValue:(NSString*)anObject{if(mDefaultValue!=anObject){[mDefaultValuerelease];mDefaultValue=[anObjectretain];}}-(BOOL)requiresDocuments{BXAssertLog(NO,@"Didn't expect %s to be called for %@.",_cmd,self);returnNO;}-(void)setRequiresDocuments:(BOOL)aBool{BXAssertLog(NO,@"Didn't expect %s to be called for %@.",_cmd,self);}@end@implementationPGTSXMLColumnDescription-(BOOL)requiresDocuments{returnmRequiresDocuments;}-(void)setRequiresDocuments:(BOOL)aBool{mRequiresDocuments=aBool;}@end