Changeset 40 in projects for punch-card/lib/card.h
- Timestamp:
- Aug 25, 2009, 5:16:00 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
punch-card/lib/card.h
r39 r40 57 57 static const int word_length = 12; 58 58 Punch::CardBit bits[ word_length ]; 59 60 CardWord(int value) { 61 for(s=0; s<word_length; s++) { 62 set(s, (value << s) & 0x01); 63 } 64 } 65 59 66 60 67 // getters and setters … … 122 129 } 123 130 131 // cast word => int 132 operator int() const { 133 int ret = 0; 134 for(int s=0; s<word_length; s++) { 135 ret |= get(s) << s; 136 } 137 } 124 138 }; // class CardWord 125 /*126 class CardWordIterator {127 int current_index;128 CardWord* card;129 130 CardWordIterator next();131 CardWordIterator previous();132 }133 */134 139 135 140 class Card { … … 162 167 class CardFile { 163 168 public: 169 int default_col_length = 80; 170 164 171 public list<Punch::Card> cards; 165 172 void write(CardFormat format, std::ostream& os);
Note: See TracChangeset
for help on using the changeset viewer.