; docformat = 'rst' ;= Operator overload methods function mg_repologentry::_overloadPrint compile_opt strictarr caldat, self.date, month, day, year, hour, minute, second _s = mg_strmerge([string(self.revision, format='(%"Revision: %s")'), $ string(self.committer, format='(%"Committer: %s")'), $ string(hour, minute, second, format='(%"%02d:%02d:%02d")') $ ]) return, _s end ;= Property access methods pro mg_repologentry::getProperty, revision=revision, committer=committer, $ date=date, comments=comments compile_opt strictarr if (arg_present(revision)) then revision = self.revision if (arg_present(committer)) then committer = self.committer if (arg_present(date)) then date = self.date if (arg_present(comments)) then comments = self.comments end ;= Lifecycle methods pro mg_repologentry::cleanup compile_opt strictarr self->IDL_Object::cleanup end function mg_repologentry::init, entry_lines compile_opt strictarr if (~self->IDL_Object::init()) then return, 0 tokens = strsplit(entry_lines[0], '|', /extract) self.revision = long(strtrim(strmid(tokens[0], 1), 2)) self.committer = strtrim(tokens[1], 2) date_tokens = strsplit(tokens[2], /extract) date = strsplit(date_tokens[0], '-', /extract) time = strsplit(date_tokens[1], ':', /extract) self.date = julday(date[1], date[2], date[0], time[0], time[1], time[2]) self.comments = mg_strmerge(entry_lines[2:*]) return, 1 end pro mg_repologentry__define compile_opt strictarr define = { MG_RepoLogEntry, inherits IDL_Object, $ revision: 0L, $ committer: '', $ date: 0.0D, $ comments: '' $ } end