Changeset 205 in dev for trunk/jenga/include
- Timestamp:
- Jul 12, 2007, 2:57:04 AM (17 years ago)
- Location:
- trunk/jenga/include
- Files:
-
- 10 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jenga/include/common/BoostXmlSupport.h
r190 r205 19 19 #include <boost/serialization/is_abstract.hpp> 20 20 21 #include <windows.h> 22 21 23 namespace Jenga{ 22 24 namespace Common{ … … 27 29 virtual const char *RootTagName() const = 0; 28 30 31 void echo( const char *msg ) const 32 { 33 MessageBox( NULL, msg, "XMLシリアライズの例外", MB_OK ); 34 } 35 29 36 public: 30 bool Read( istream& ifs )37 bool Read( istream& ifs, bool isShowExceptionMessage = true ) 31 38 { 32 39 bool isSuccessful = false; … … 40 47 isSuccessful = true; 41 48 } 49 catch( boost::archive::archive_exception e ) 50 { 51 if( isShowExceptionMessage ) 52 { 53 echo( e.what() ); 54 } 55 } 42 56 catch(...){ 43 // 失敗 57 if( isShowExceptionMessage ) 58 { 59 echo( "archive_exception以外の不明な例外" ); 60 } 44 61 } 45 62 … … 52 69 } 53 70 54 bool Write( ostream& ofs ) const71 bool Write( ostream& ofs, bool isShowExceptionMessage = true ) const 55 72 { 56 73 bool isSuccessful = false; … … 64 81 isSuccessful = true; 65 82 } 66 catch( ... ){ 67 // 失敗 83 catch( boost::archive::archive_exception e ) 84 { 85 if( isShowExceptionMessage ) 86 { 87 echo( e.what() ); 88 } 89 } 90 catch(...){ 91 if( isShowExceptionMessage ) 92 { 93 echo( "archive_exception以外の不明な例外" ); 94 } 68 95 } 69 96 … … 76 103 } 77 104 78 bool Read( const string &xmlFilePath )105 bool Read( const string &xmlFilePath, bool isShowExceptionMessage = true ) 79 106 { 80 107 bool isSuccessful = false; … … 83 110 std::ifstream ifs( xmlFilePath.c_str() ); 84 111 85 bool result = Read(ifs );112 bool result = Read(ifs,isShowExceptionMessage); 86 113 87 114 // 入力を閉じる … … 91 118 } 92 119 93 bool Write( const string &xmlFilePath ) const120 bool Write( const string &xmlFilePath, bool isShowExceptionMessage = true ) const 94 121 { 95 122 // 出力アーカイブの作成 96 123 std::ofstream ofs( xmlFilePath.c_str() ); 97 124 98 bool result = Write(ofs );125 bool result = Write(ofs,isShowExceptionMessage); 99 126 100 127 // 出力を閉じる … … 104 131 } 105 132 106 bool ReadFromString( const wstring &xmlBuffer )133 bool ReadFromString( const string &xmlBuffer ) 107 134 { 108 135 bool isSuccessful = false; -
trunk/jenga/include/common/logger.h
r166 r205 13 13 14 14 #include <jenga/include/common/Environment.h> 15 #include <jenga/include/common/BoostXmlSupport.h> 15 16 16 17 #define STDX_DSTREAM_BUFFERING … … 23 24 24 25 26 class LoggerSetting : public BoostXmlSupport<LoggerSetting> 27 { 28 public: 29 int stopStep; 30 31 LoggerSetting() 32 : stopStep( -1 ) 33 { 34 } 35 36 // XMLシリアライズ用 37 private: 38 virtual const char *RootTagName() const 39 { 40 return "loggerSetting"; 41 } 42 friend class boost::serialization::access; 43 template<class Archive> void serialize(Archive& ar, const unsigned int version) 44 { 45 ar & BOOST_SERIALIZATION_NVP( stopStep ); 46 } 47 }; 48 49 25 50 // VC++ で STLport だと using std::char_traits; みたいなのが必要かも 26 51 template <typename Ch_T, typename Tr_T = std::char_traits<Ch_T> > … … 29 54 protected: 30 55 std::string saveFilePath; 56 int count; 57 LoggerSetting setting; 31 58 32 59 public: 33 basic_dbg_streambuf( const std::string &saveFilePath )60 basic_dbg_streambuf( const std::string &saveFilePath, bool isOptionEnabled ) 34 61 : saveFilePath( saveFilePath ) 62 , count( 0 ) 35 63 { 36 64 #ifndef STDX_DSTREAM_BUFFERING 37 65 setbuf(0,0); 38 66 #endif 67 68 if( isOptionEnabled ) 69 { 70 // 設定ファイルを読み込む 71 char temporary[MAX_PATH]; 72 char temp2[MAX_PATH]; 73 char temp3[MAX_PATH]; 74 _splitpath(saveFilePath.c_str(),temporary,temp2,temp3,NULL); 75 setting.Read( (string)temporary + temp2 + temp3 + ".setting.xml", false ); 76 } 39 77 } 40 78 … … 59 97 { 60 98 ofstream ofs( ( saveFilePath ).c_str(), ios_base::app ); 61 ofs << str ;99 ofs << "[" << (count++) << "] " << str ; 62 100 ofs.close(); 101 102 if( (count-1) == setting.stopStep ) 103 { 104 DebugBreak(); 105 } 63 106 } 64 107 … … 67 110 { 68 111 public: 69 basic_dbg_ostream( const string &saveFilePath )70 : std::basic_ostream<Ch_T, Tr_T>(new basic_dbg_streambuf<Ch_T, Tr_T>(saveFilePath ))112 basic_dbg_ostream( const string &saveFilePath, bool isOptionEnabled ) 113 : std::basic_ostream<Ch_T, Tr_T>(new basic_dbg_streambuf<Ch_T, Tr_T>(saveFilePath,isOptionEnabled)) 71 114 { 72 115 ofstream ofs( ( saveFilePath ).c_str(), ios_base::trunc ); … … 87 130 88 131 }} 132 133 BOOST_CLASS_IMPLEMENTATION(Jenga::Common::LoggerSetting, boost::serialization::object_serializable); -
trunk/jenga/include/smoothie/BasicFixed.h
r170 r205 186 186 #define ESC_IMPORTS 'q' // Imports 187 187 #define ESC_CLEARNAMESPACEIMPORTED 'r' // _ClearNamespaceImported 188 #define ESC_OPERATOR 's' 188 189 //EXEファイル用制御エスケープシーケンス 189 #define ESC_USING ' s' // Print命令語のUsing190 #define ESC_FOR ' t' // Open命令語のFor191 #define ESC_LINENUM ' u' // 行番号を示す190 #define ESC_USING 't' // Print命令語のUsing 191 #define ESC_FOR 'u' // Open命令語のFor 192 #define ESC_LINENUM 'v' // 行番号を示す 192 193 193 194 //オブジェクト指向エスケープシーケンス … … 203 204 #define ESC_INTERFACE (char)0xA9 204 205 #define ESC_ENDINTERFACE (char)0xAA 205 #define ESC_OPERATOR (char)0xAB -
trunk/jenga/include/smoothie/LexicalAnalysis.h
r173 r205 1 1 #pragma once 2 3 #include <string> 4 #include <vector> 5 6 #include <windows.h> 7 8 typedef std::vector<int> Subscripts; 9 10 enum ReferenceKind 11 { 12 RefNon = 0, // no reference member 13 RefDot, // obj.member 14 RefPointer, // obj->member 15 }; 2 16 3 17 bool IsVariableTopChar(char c); … … 13 27 bool IsCommandDelimitation( char c ); 14 28 int GetStringInPare_RemovePare(char *buffer,const char *ReadBuffer); 15 void GetArrange(char *variable,char *variAnswer,int *SubScripts); 29 void GetArrange(char *variable,char *variAnswer, Subscripts &subscripts ); 30 bool SplitMemberName( const char *desc, char *object, char *member, ReferenceKind &refType ); 31 bool SplitMemberName( const char *desc, char *object, char *member ); 32 void GetCalcName(int idCalc,char *name); 33 BYTE ToCalcId( const char *name ); 34 std::string Operator_NaturalStringToCalcMarkString( const std::string &name ); 35 std::string Operator_CalcMarkStringToNaturalString( const std::string &name ); -
trunk/jenga/include/smoothie/LexicalScoping.h
r181 r205 56 56 57 57 // スコープを終了 58 v oid End();58 virtual void End() = 0; 59 59 60 60 // スコープを検索 -
trunk/jenga/include/smoothie/Smoothie.h
r194 r205 2 2 3 3 #include "Source.h" 4 #include "ObjectModule.h"5 4 #include "LexicalScoping.h" 6 5 … … 27 26 class Temp{ 28 27 public: 29 // コンパイル中のクラス30 static const CClass *pCompilingClass;31 32 28 // レキシカルスコープの状態 33 29 static CLexicalScopes *pLexicalScopes; -
trunk/jenga/include/smoothie/Source.h
r173 r205 7 7 #include <stdlib.h> 8 8 9 #include "BasicFixed.h" 9 #include <jenga/include/common/Exception.h> 10 #include <jenga/include/smoothie/BasicFixed.h> 10 11 11 12 using namespace std; … … 100 101 if( index>GetLength() ) 101 102 { 102 throw "bad access";103 Jenga::Throw( "BasicSource bad access" ); 103 104 } 104 105 return buffer[2+index];
Note:
See TracChangeset
for help on using the changeset viewer.