This is the source for the whole header file
Code:
/*
* carbonGraphicIO.h
*
*
* Created by Erik Schmidt on 3/25/05.
* Copyright 2005 Erik_Soft. All rights reserved.
*
* Provides eased IO capability within data fields in a carbon application
*
* C++ version
*
*/
#include <Carbon/Carbon.h>
#include <sstream>
#include <string>
#include <cstring>
using namespace std;
class DataField {
private:
ControlID contID;
CFStringRef cfbuffer;
ostringstream strstrBuffer;
WindowRef window;
ControlHandle conthan;
Size actualSize;
public:
//class Constructor
DataField(ControlID commid,WindowRef win){
contID=commid;
window=win;
}//end DataField
//Gets a CFString from the data field, takes no arguments, returns a CFStringRef
CFStringRef getCFStringData(){
GetControlByID(window,&contID,&conthan);
GetControlData(conthan,0,kControlEditTextCFStringTag,sizeof(CFStringRef),&cfbuffer,&actualSize);
return cfbuffer;
}//end getCFStringData
//Gets a c++ string from the data field, takes no arguments, returns a c++ string
string getCppStringData(){
cfbuffer=getCFStringData();
strstrBuffer<<cfbuffer<<flush;
return strstrBuffer.str();
}//end getCppStringData
};//end class DataField