File: classGitModel.html

package info (click to toggle)
witty 3.1.2-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 45,512 kB
  • ctags: 35,832
  • sloc: cpp: 69,469; ansic: 66,945; xml: 4,383; sh: 594; perl: 108; makefile: 106
file content (730 lines) | stat: -rw-r--r-- 56,139 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Wt examples: GitModel Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>GitModel Class Reference<br>
<small>
[<a class="el" href="group__gitmodelexample.html">Git model example</a>]</small>
</h1><!-- doxytag: class="GitModel" --><!-- doxytag: inherits="Wt::WAbstractItemModel" -->A model that retrieves revision trees from a git repository.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="GitModel_8h-source.html">GitModel.h</a>&gt;</code>
<p>
<div class="dynheader">
Inheritance diagram for GitModel:</div>
<div class="dynsection">
<p><center><img src="classGitModel__inherit__graph.png" border="0" usemap="#GitModel__inherit__map" alt="Inheritance graph"></center>
<map name="GitModel__inherit__map">
<area shape="rect" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WAbstractItemModel.html" title="Wt::WAbstractItemModel" alt="" coords="5,80,171,107"><area shape="rect" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WObject.html" title="Wt::WObject" alt="" coords="40,5,136,32"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>

<p>
<a href="classGitModel-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitModel.html#056f5d6c45226ca08ada28e72eed294a">GitModel</a> (<a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WObject.html">Wt::WObject</a> *parent=0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor.  <a href="#056f5d6c45226ca08ada28e72eed294a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitModel.html#ac776e532822827e59a2233645995e65">setRepositoryPath</a> (const std::string &amp;repositoryPath)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the repository and load its 'master' revision.  <a href="#ac776e532822827e59a2233645995e65"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitModel.html#f78bddbae2d7b76ec1e49d8626dc7526">loadRevision</a> (const std::string &amp;revName)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Load a particular revision.  <a href="#f78bddbae2d7b76ec1e49d8626dc7526"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">Wt::WModelIndex</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitModel.html#d707c92d586f8232f5e452b2b3cecc1b">parent</a> (const <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">Wt::WModelIndex</a> &amp;index) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the parent index.  <a href="#d707c92d586f8232f5e452b2b3cecc1b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitModel.html#78b52d35048396dc60aa660b1d5bcf55">columnCount</a> (const <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">Wt::WModelIndex</a> &amp;parent=<a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">Wt::WModelIndex</a>()) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the column count.  <a href="#78b52d35048396dc60aa660b1d5bcf55"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitModel.html#a5f75edbb291d0b03c22fc8a608a3171">rowCount</a> (const <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">Wt::WModelIndex</a> &amp;parent=<a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">Wt::WModelIndex</a>()) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the row count.  <a href="#a5f75edbb291d0b03c22fc8a608a3171"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">Wt::WModelIndex</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitModel.html#47f5ebf88be96b003b4bf31bfafff141">index</a> (int row, int column, const <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">Wt::WModelIndex</a> &amp;parent=<a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">Wt::WModelIndex</a>()) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a child index.  <a href="#47f5ebf88be96b003b4bf31bfafff141"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual boost::any&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitModel.html#6e30f8cddbb1039d7d749eaafa1120a8">data</a> (const <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">Wt::WModelIndex</a> &amp;index, int role=<a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/group__modelview.html#gg0ae864e12320f9f89172735e075ed0685ed17aded8a0e3b712698cf85a218f1f">Wt::DisplayRole</a>) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns data.  <a href="#6e30f8cddbb1039d7d749eaafa1120a8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual boost::any&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitModel.html#23fb9ef292e416fbdf20790a2a93c016">headerData</a> (int section, <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/namespaceWt.html#2a8d45559e16a0185bf61bfad0a67912">Wt::Orientation</a> orientation=<a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/namespaceWt.html#2a8d45559e16a0185bf61bfad0a67912c2ebf22b096a22b18eef23e736aa2e28">Wt::Horizontal</a>, int role=<a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/group__modelview.html#gg0ae864e12320f9f89172735e075ed0685ed17aded8a0e3b712698cf85a218f1f">Wt::DisplayRole</a>) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns header data.  <a href="#23fb9ef292e416fbdf20790a2a93c016"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Static Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static const int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitModel.html#49c30024f0241738b30cf4cec589b292">ContentsRole</a> = <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/group__modelview.html#gg0ae864e12320f9f89172735e075ed0689b7eae9fc07ea4fd8afe7bc97954162c">Wt::UserRole</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The role which may be used on a file to retrieve its contents.  <a href="#49c30024f0241738b30cf4cec589b292"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static const int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitModel.html#9419f872ce68506009748f0595400ef7">FilePathRole</a> = <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/group__modelview.html#gg0ae864e12320f9f89172735e075ed0689b7eae9fc07ea4fd8afe7bc97954162c">Wt::UserRole</a> + 1</td></tr>

<tr><td colspan="2"><br><h2>Private Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef std::map&lt; <a class="el" href="structGitModel_1_1ChildIndex.html">ChildIndex</a>, int &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitModel.html#5bdd5d3dea3e158889afc795b455d103">ChildPointerMap</a></td></tr>

<tr><td colspan="2"><br><h2>Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitModel.html#b2efe3ae663dfbd670dc41dd3cb8d2a0">getTreeId</a> (int parentId, int childIndex) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get or allocate an id for a folder.  <a href="#b2efe3ae663dfbd670dc41dd3cb8d2a0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structGit_1_1Object.html">Git::Object</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitModel.html#0eec46284e84c7deeb1a39eb7185d1d1">getObject</a> (const <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">Wt::WModelIndex</a> &amp;index) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the <a class="el" href="structGit_1_1Object.html" title="Git object.">Git::Object</a> that corresponds to an index.  <a href="#0eec46284e84c7deeb1a39eb7185d1d1"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classGit.html">Git</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitModel.html#fc8ff43e47ae51ce2af04d63a162be8e">git_</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The git repository.  <a href="#fc8ff43e47ae51ce2af04d63a162be8e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::vector&lt; <a class="el" href="classGitModel_1_1Tree.html">Tree</a> &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitModel.html#59307dfceb1f5712914e0754144422e4">treeData_</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">List of folder objects.  <a href="#59307dfceb1f5712914e0754144422e4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classGitModel.html#5bdd5d3dea3e158889afc795b455d103">ChildPointerMap</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitModel.html#4f3e07cf6dddd098c4c4f0978be0fe90">childPointer_</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Maps child indexes to tree indexes.  <a href="#4f3e07cf6dddd098c4c4f0978be0fe90"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structGitModel_1_1ChildIndex.html">ChildIndex</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Index usable as a key to a map, that identifies a child/row within a tree.  <a href="structGitModel_1_1ChildIndex.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGitModel_1_1Tree.html">Tree</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Used to uniquely locate a folder within the folder hierarchy.  <a href="classGitModel_1_1Tree.html#_details">More...</a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A model that retrieves revision trees from a git repository. 
<p>
In its present form, it presents only a single column of data: the file names. Additional data could be easily added. <a class="el" href="classGit.html" title="Git utility class for browsing git archives.">Git</a> "tree" objects correspond to folders, and "blob" objects to files.<p>
The model is read-only, does not support sorting (that could be provided by using a WSortFilterProxyModel).<p>
The model loads only minimal information in memory: to create model indexes for folders. These cannot be uniquely identified by their SHA1 id, since two identical folders at different locations would have the same SHA1 id.<p>
The internal id of model indexes created by the model uniquely identify a containing folder for a particular file. 
<p>Definition at line <a class="el" href="GitModel_8h-source.html#l00036">36</a> of file <a class="el" href="GitModel_8h-source.html">GitModel.h</a>.</p>
<hr><h2>Member Typedef Documentation</h2>
<a class="anchor" name="5bdd5d3dea3e158889afc795b455d103"></a><!-- doxytag: member="GitModel::ChildPointerMap" ref="5bdd5d3dea3e158889afc795b455d103" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef std::map&lt;<a class="el" href="structGitModel_1_1ChildIndex.html">ChildIndex</a>, int&gt; <a class="el" href="classGitModel.html#5bdd5d3dea3e158889afc795b455d103">GitModel::ChildPointerMap</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Definition at line <a class="el" href="GitModel_8h-source.html#l00161">161</a> of file <a class="el" href="GitModel_8h-source.html">GitModel.h</a>.</p>

</div>
</div><p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="056f5d6c45226ca08ada28e72eed294a"></a><!-- doxytag: member="GitModel::GitModel" ref="056f5d6c45226ca08ada28e72eed294a" args="(Wt::WObject *parent=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">GitModel::GitModel           </td>
          <td>(</td>
          <td class="paramtype"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WObject.html">Wt::WObject</a> *&nbsp;</td>
          <td class="paramname"> <em>parent</em> = <code>0</code>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Constructor. 
<p>

<p>Definition at line <a class="el" href="GitModel_8C-source.html#l00011">11</a> of file <a class="el" href="GitModel_8C-source.html">GitModel.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00012"></a>00012   : <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WAbstractItemModel.html#ceb39c2027dc4dc464ac5942798e62e6">WAbstractItemModel</a>(parent)
<a name="l00013"></a>00013 { }
</pre></div>
<p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="ac776e532822827e59a2233645995e65"></a><!-- doxytag: member="GitModel::setRepositoryPath" ref="ac776e532822827e59a2233645995e65" args="(const std::string &amp;repositoryPath)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void GitModel::setRepositoryPath           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>repositoryPath</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set the repository and load its 'master' revision. 
<p>

<p>Definition at line <a class="el" href="GitModel_8C-source.html#l00015">15</a> of file <a class="el" href="GitModel_8C-source.html">GitModel.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00016"></a>00016 {
<a name="l00017"></a>00017   <a class="code" href="classGitModel.html#fc8ff43e47ae51ce2af04d63a162be8e" title="The git repository.">git_</a>.<a class="code" href="classGit.html#b21f8d442557b07321a274b5e976f1ac" title="Set the git repository path.">setRepositoryPath</a>(gitRepositoryPath);
<a name="l00018"></a>00018   <a class="code" href="classGitModel.html#f78bddbae2d7b76ec1e49d8626dc7526" title="Load a particular revision.">loadRevision</a>(<span class="stringliteral">"master"</span>);
<a name="l00019"></a>00019 }
</pre></div>
<p>

</div>
</div><p>
<a class="anchor" name="f78bddbae2d7b76ec1e49d8626dc7526"></a><!-- doxytag: member="GitModel::loadRevision" ref="f78bddbae2d7b76ec1e49d8626dc7526" args="(const std::string &amp;revName)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void GitModel::loadRevision           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>revName</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Load a particular revision. 
<p>
The revision name may be any revision accepted by git, by git-rev-parse(1). 
<p>Definition at line <a class="el" href="GitModel_8C-source.html#l00021">21</a> of file <a class="el" href="GitModel_8C-source.html">GitModel.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00022"></a>00022 {
<a name="l00023"></a>00023   <a class="code" href="classGit_1_1ObjectId.html" title="Git object Id.">Git::ObjectId</a> treeRoot = <a class="code" href="classGitModel.html#fc8ff43e47ae51ce2af04d63a162be8e" title="The git repository.">git_</a>.<a class="code" href="classGit.html#521bba51875ea14c9e39a14fcde01e04" title="Get the tree for a particular revision.">getCommitTree</a>(revName);
<a name="l00024"></a>00024 
<a name="l00025"></a>00025   <span class="comment">// You need to call this method before invalidating all existing</span>
<a name="l00026"></a>00026   <span class="comment">// model indexes. Anyone listening for this event could temporarily</span>
<a name="l00027"></a>00027   <span class="comment">// convert some model indexes to a raw index pointer, but this model</span>
<a name="l00028"></a>00028   <span class="comment">// does not reimplement these methods.</span>
<a name="l00029"></a>00029   <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WAbstractItemModel.html#abe99309231808a48c8f1db2c462f8e2">layoutAboutToBeChanged</a>().<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1Signal.html#b9ec97260c79e7b546b7235ad2ffd627">emit</a>();
<a name="l00030"></a>00030 
<a name="l00031"></a>00031   <a class="code" href="classGitModel.html#59307dfceb1f5712914e0754144422e4" title="List of folder objects.">treeData_</a>.clear();
<a name="l00032"></a>00032   <a class="code" href="classGitModel.html#4f3e07cf6dddd098c4c4f0978be0fe90" title="Maps child indexes to tree indexes.">childPointer_</a>.clear();
<a name="l00033"></a>00033 
<a name="l00034"></a>00034   <span class="comment">// Store the tree root as treeData_[0]</span>
<a name="l00035"></a>00035   <a class="code" href="classGitModel.html#59307dfceb1f5712914e0754144422e4" title="List of folder objects.">treeData_</a>.push_back(Tree(-1, -1, treeRoot));
<a name="l00036"></a>00036 
<a name="l00037"></a>00037   <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WAbstractItemModel.html#5a6a3810afb5333405887df52827db02">layoutChanged</a>().<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1Signal.html#b9ec97260c79e7b546b7235ad2ffd627">emit</a>();
<a name="l00038"></a>00038 }
</pre></div>
<p>

</div>
</div><p>
<a class="anchor" name="d707c92d586f8232f5e452b2b3cecc1b"></a><!-- doxytag: member="GitModel::parent" ref="d707c92d586f8232f5e452b2b3cecc1b" args="(const Wt::WModelIndex &amp;index) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">WModelIndex</a> GitModel::parent           </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">Wt::WModelIndex</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>index</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the parent index. 
<p>
Consults the internal data structure to find the parent index. 
<p>Implements <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WAbstractItemModel.html#da454d45706ca0c1a0921dedd351c48c">Wt::WAbstractItemModel</a>.</p>

<p>Definition at line <a class="el" href="GitModel_8C-source.html#l00040">40</a> of file <a class="el" href="GitModel_8C-source.html">GitModel.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00041"></a>00041 {
<a name="l00042"></a>00042   <span class="comment">// treeData_[0] indicates the top-level parent.</span>
<a name="l00043"></a>00043   <span class="keywordflow">if</span> (!index.<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html#1d4b05ee51c5c6961d6123565fd77c82">isValid</a>() || index.<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html#f0fedac552dfeb6162f10d26d0876c85">internalId</a>() == 0)
<a name="l00044"></a>00044     <span class="keywordflow">return</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">WModelIndex</a>();
<a name="l00045"></a>00045   <span class="keywordflow">else</span> {
<a name="l00046"></a>00046     <span class="comment">// get the item that corresponds to the parent ...</span>
<a name="l00047"></a>00047     <span class="keyword">const</span> Tree&amp; item = <a class="code" href="classGitModel.html#59307dfceb1f5712914e0754144422e4" title="List of folder objects.">treeData_</a>[index.<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html#f0fedac552dfeb6162f10d26d0876c85">internalId</a>()];
<a name="l00048"></a>00048 
<a name="l00049"></a>00049     <span class="comment">// ... and construct that identifies the parent:</span>
<a name="l00050"></a>00050     <span class="comment">//   row = child index in the grand parent</span>
<a name="l00051"></a>00051     <span class="comment">//   internalId = id of the grand parent</span>
<a name="l00052"></a>00052     <span class="keywordflow">return</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WAbstractItemModel.html#c837a73fe423255035ffb076946de122">createIndex</a>(item.index(), 0, item.parentId()); 
<a name="l00053"></a>00053   }
<a name="l00054"></a>00054 }
</pre></div>
<p>

</div>
</div><p>
<a class="anchor" name="78b52d35048396dc60aa660b1d5bcf55"></a><!-- doxytag: member="GitModel::columnCount" ref="78b52d35048396dc60aa660b1d5bcf55" args="(const Wt::WModelIndex &amp;parent=Wt::WModelIndex()) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int GitModel::columnCount           </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">Wt::WModelIndex</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>parent</em> = <code><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">Wt::WModelIndex</a>()</code>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the column count. 
<p>
Returns 1. 
<p>Implements <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WAbstractItemModel.html#bcf7912a95a0a60f8e9b1c37d30b8383">Wt::WAbstractItemModel</a>.</p>

<p>Definition at line <a class="el" href="GitModel_8C-source.html#l00097">97</a> of file <a class="el" href="GitModel_8C-source.html">GitModel.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00098"></a>00098 {
<a name="l00099"></a>00099   <span class="comment">// currently only one column</span>
<a name="l00100"></a>00100   <span class="keywordflow">return</span> 1;
<a name="l00101"></a>00101 }
</pre></div>
<p>

</div>
</div><p>
<a class="anchor" name="a5f75edbb291d0b03c22fc8a608a3171"></a><!-- doxytag: member="GitModel::rowCount" ref="a5f75edbb291d0b03c22fc8a608a3171" args="(const Wt::WModelIndex &amp;parent=Wt::WModelIndex()) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int GitModel::rowCount           </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">Wt::WModelIndex</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>parent</em> = <code><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">Wt::WModelIndex</a>()</code>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the row count. 
<p>
Returns 0 unless the item represents a folder, in which case it returns the number of items in the tree object that corresponds to the folder. 
<p>Implements <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WAbstractItemModel.html#b0709a8f71fd5df882f29bb29fd055f0">Wt::WAbstractItemModel</a>.</p>

<p>Definition at line <a class="el" href="GitModel_8C-source.html#l00103">103</a> of file <a class="el" href="GitModel_8C-source.html">GitModel.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00104"></a>00104 {
<a name="l00105"></a>00105   <span class="comment">// we are looking for the git SHA1 id of a tree object (since only folders</span>
<a name="l00106"></a>00106   <span class="comment">// may contain children).</span>
<a name="l00107"></a>00107   <a class="code" href="classGit_1_1ObjectId.html" title="Git object Id.">Git::ObjectId</a> objectId;
<a name="l00108"></a>00108 
<a name="l00109"></a>00109   <span class="keywordflow">if</span> (<a class="code" href="classGitModel.html#47f5ebf88be96b003b4bf31bfafff141" title="Returns a child index.">index</a>.<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html#1d4b05ee51c5c6961d6123565fd77c82">isValid</a>()) {
<a name="l00110"></a>00110     <span class="comment">// only column 0 items may contain children</span>
<a name="l00111"></a>00111     <span class="keywordflow">if</span> (<a class="code" href="classGitModel.html#47f5ebf88be96b003b4bf31bfafff141" title="Returns a child index.">index</a>.<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html#0e6568dd7113662c3c378e2084729581">column</a>() != 0)
<a name="l00112"></a>00112       <span class="keywordflow">return</span> 0;
<a name="l00113"></a>00113 
<a name="l00114"></a>00114     <a class="code" href="structGit_1_1Object.html" title="Git object.">Git::Object</a> o = <a class="code" href="classGitModel.html#0eec46284e84c7deeb1a39eb7185d1d1" title="Get the Git::Object that corresponds to an index.">getObject</a>(<a class="code" href="classGitModel.html#47f5ebf88be96b003b4bf31bfafff141" title="Returns a child index.">index</a>);
<a name="l00115"></a>00115     <span class="keywordflow">if</span> (o.<a class="code" href="structGit_1_1Object.html#2ea77791af4fa6012b350469654332cc">type</a> == <a class="code" href="classGit.html#b282f46c36a47ddff9bc7be7c993041ae94d3a7ff6594f6b3b0dc121fbd01564">Git::Tree</a>) {
<a name="l00116"></a>00116       objectId = o.<a class="code" href="structGit_1_1Object.html#2e3989983524516e4a936714b55736ff">id</a>;
<a name="l00117"></a>00117     } <span class="keywordflow">else</span>
<a name="l00118"></a>00118       <span class="comment">// not a folder: no children</span>
<a name="l00119"></a>00119       <span class="keywordflow">return</span> 0;
<a name="l00120"></a>00120   } <span class="keywordflow">else</span>
<a name="l00121"></a>00121     <span class="comment">// the index corresponds to the root object</span>
<a name="l00122"></a>00122     <span class="keywordflow">if</span> (<a class="code" href="classGitModel.html#59307dfceb1f5712914e0754144422e4" title="List of folder objects.">treeData_</a>.empty())
<a name="l00123"></a>00123       <span class="comment">// model not yet loaded !</span>
<a name="l00124"></a>00124       <span class="keywordflow">return</span> 0;
<a name="l00125"></a>00125     <span class="keywordflow">else</span>
<a name="l00126"></a>00126       objectId = <a class="code" href="classGitModel.html#59307dfceb1f5712914e0754144422e4" title="List of folder objects.">treeData_</a>[0].treeObject();
<a name="l00127"></a>00127 
<a name="l00128"></a>00128   <span class="keywordflow">return</span> <a class="code" href="classGitModel.html#fc8ff43e47ae51ce2af04d63a162be8e" title="The git repository.">git_</a>.<a class="code" href="classGit.html#be86381afbbab0adb0680ae268752f1f" title="Return the number of objects inside a tree object.">treeSize</a>(objectId);
<a name="l00129"></a>00129 }
</pre></div>
<p>

</div>
</div><p>
<a class="anchor" name="47f5ebf88be96b003b4bf31bfafff141"></a><!-- doxytag: member="GitModel::index" ref="47f5ebf88be96b003b4bf31bfafff141" args="(int row, int column, const Wt::WModelIndex &amp;parent=Wt::WModelIndex()) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">WModelIndex</a> GitModel::index           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>row</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>column</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">Wt::WModelIndex</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>parent</em> = <code><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">Wt::WModelIndex</a>()</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns a child index. 
<p>
Consults the internal data structure to create a child index. If necessary, the internal data structure is expanded by adding an entry for using the <em>parent</em> index as a parent index. 
<p>Implements <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WAbstractItemModel.html#83f37bf04b8574b328c139b02523b8cb">Wt::WAbstractItemModel</a>.</p>

<p>Definition at line <a class="el" href="GitModel_8C-source.html#l00056">56</a> of file <a class="el" href="GitModel_8C-source.html">GitModel.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00058"></a>00058 {
<a name="l00059"></a>00059   <span class="keywordtype">int</span> parentId;
<a name="l00060"></a>00060 
<a name="l00061"></a>00061   <span class="comment">// the top-level parent has id=0.</span>
<a name="l00062"></a>00062   <span class="keywordflow">if</span> (!parent.<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html#1d4b05ee51c5c6961d6123565fd77c82">isValid</a>())
<a name="l00063"></a>00063     parentId = 0;
<a name="l00064"></a>00064   <span class="keywordflow">else</span> {
<a name="l00065"></a>00065     <span class="comment">// the internal id of the parent identifies the grand parent</span>
<a name="l00066"></a>00066     <span class="keywordtype">int</span> grandParentId = parent.<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html#f0fedac552dfeb6162f10d26d0876c85">internalId</a>();
<a name="l00067"></a>00067 
<a name="l00068"></a>00068     <span class="comment">// lookup the parent id for the parent himself, based on grand parent</span>
<a name="l00069"></a>00069     <span class="comment">// and child-index (=row) within the grand parent</span>
<a name="l00070"></a>00070     parentId = <a class="code" href="classGitModel.html#b2efe3ae663dfbd670dc41dd3cb8d2a0" title="Get or allocate an id for a folder.">getTreeId</a>(grandParentId, parent.<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html#a4f1385223391c46ee200a57672f6046">row</a>());
<a name="l00071"></a>00071   }
<a name="l00072"></a>00072 
<a name="l00073"></a>00073   <span class="keywordflow">return</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WAbstractItemModel.html#c837a73fe423255035ffb076946de122">createIndex</a>(row, column, parentId);
<a name="l00074"></a>00074 }
</pre></div>
<p>

</div>
</div><p>
<a class="anchor" name="6e30f8cddbb1039d7d749eaafa1120a8"></a><!-- doxytag: member="GitModel::data" ref="6e30f8cddbb1039d7d749eaafa1120a8" args="(const Wt::WModelIndex &amp;index, int role=Wt::DisplayRole) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boost::any GitModel::data           </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">Wt::WModelIndex</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>role</em> = <code><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/group__modelview.html#gg0ae864e12320f9f89172735e075ed0685ed17aded8a0e3b712698cf85a218f1f">Wt::DisplayRole</a></code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns data. 
<p>
Returns only data corresponding to DisplayRole and ContentsRole. 
<p>Implements <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WAbstractItemModel.html#9112b74d160f916ef75fb6c1c09dd8fe">Wt::WAbstractItemModel</a>.</p>

<p>Definition at line <a class="el" href="GitModel_8C-source.html#l00131">131</a> of file <a class="el" href="GitModel_8C-source.html">GitModel.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00132"></a>00132 {
<a name="l00133"></a>00133   <span class="keywordflow">if</span> (!index.<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html#1d4b05ee51c5c6961d6123565fd77c82">isValid</a>())
<a name="l00134"></a>00134     <span class="keywordflow">return</span> boost::any();
<a name="l00135"></a>00135 
<a name="l00136"></a>00136   <span class="comment">/* Only 3 data roles on column 0 data are supported:</span>
<a name="l00137"></a>00137 <span class="comment">   * - DisplayRole: the file name</span>
<a name="l00138"></a>00138 <span class="comment">   * - DecorationRole: an icon (folder or file)</span>
<a name="l00139"></a>00139 <span class="comment">   * - ContentsRole: the file contents</span>
<a name="l00140"></a>00140 <span class="comment">   */</span>
<a name="l00141"></a>00141   <span class="keywordflow">if</span> (index.<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html#0e6568dd7113662c3c378e2084729581">column</a>() == 0) {
<a name="l00142"></a>00142     <a class="code" href="structGit_1_1Object.html" title="Git object.">Git::Object</a> <span class="keywordtype">object</span> = <a class="code" href="classGitModel.html#0eec46284e84c7deeb1a39eb7185d1d1" title="Get the Git::Object that corresponds to an index.">getObject</a>(index);
<a name="l00143"></a>00143     <span class="keywordflow">if</span> (role == <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/group__modelview.html#gg0ae864e12320f9f89172735e075ed0685ed17aded8a0e3b712698cf85a218f1f">DisplayRole</a>) {
<a name="l00144"></a>00144       <span class="keywordflow">if</span> (<span class="keywordtype">object</span>.type == <a class="code" href="classGit.html#b282f46c36a47ddff9bc7be7c993041ae94d3a7ff6594f6b3b0dc121fbd01564">Git::Tree</a>)
<a name="l00145"></a>00145         <span class="keywordflow">return</span> <span class="keywordtype">object</span>.name + <span class="charliteral">'/'</span>;
<a name="l00146"></a>00146       <span class="keywordflow">else</span>
<a name="l00147"></a>00147         <span class="keywordflow">return</span> <span class="keywordtype">object</span>.name;
<a name="l00148"></a>00148     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (role == <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/group__modelview.html#gg0ae864e12320f9f89172735e075ed068ab6678fc176854f7990d6cff4eed779e">DecorationRole</a>) {
<a name="l00149"></a>00149       <span class="keywordflow">if</span> (<span class="keywordtype">object</span>.type == <a class="code" href="classGit.html#b282f46c36a47ddff9bc7be7c993041a64c3a7b641cdc0cb2c4203fc0bef1a4a">Git::Blob</a>)
<a name="l00150"></a>00150         <span class="keywordflow">return</span> <span class="stringliteral">"icons/git-blob.png"</span>;
<a name="l00151"></a>00151       <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<span class="keywordtype">object</span>.type == <a class="code" href="classGit.html#b282f46c36a47ddff9bc7be7c993041ae94d3a7ff6594f6b3b0dc121fbd01564">Git::Tree</a>)
<a name="l00152"></a>00152         <span class="keywordflow">return</span> <span class="stringliteral">"icons/git-tree.png"</span>;
<a name="l00153"></a>00153     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (role == <a class="code" href="classGitModel.html#49c30024f0241738b30cf4cec589b292" title="The role which may be used on a file to retrieve its contents.">ContentsRole</a>) {
<a name="l00154"></a>00154       <span class="keywordflow">if</span> (<span class="keywordtype">object</span>.type == <a class="code" href="classGit.html#b282f46c36a47ddff9bc7be7c993041a64c3a7b641cdc0cb2c4203fc0bef1a4a">Git::Blob</a>)
<a name="l00155"></a>00155         <span class="keywordflow">return</span> <a class="code" href="classGitModel.html#fc8ff43e47ae51ce2af04d63a162be8e" title="The git repository.">git_</a>.<a class="code" href="classGit.html#cf2d699d9f9bdfb42afb0f61e85b2f88" title="Return the raw contents of a git object.">catFile</a>(<span class="keywordtype">object</span>.<span class="keywordtype">id</span>);
<a name="l00156"></a>00156     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (role == <a class="code" href="classGitModel.html#9419f872ce68506009748f0595400ef7">FilePathRole</a>) {
<a name="l00157"></a>00157       <span class="keywordflow">return</span> boost::any();
<a name="l00158"></a>00158     }
<a name="l00159"></a>00159   }
<a name="l00160"></a>00160 
<a name="l00161"></a>00161   <span class="keywordflow">return</span> boost::any();
<a name="l00162"></a>00162 }
</pre></div>
<p>

</div>
</div><p>
<a class="anchor" name="23fb9ef292e416fbdf20790a2a93c016"></a><!-- doxytag: member="GitModel::headerData" ref="23fb9ef292e416fbdf20790a2a93c016" args="(int section, Wt::Orientation orientation=Wt::Horizontal, int role=Wt::DisplayRole) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boost::any GitModel::headerData           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>section</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/namespaceWt.html#2a8d45559e16a0185bf61bfad0a67912">Wt::Orientation</a>&nbsp;</td>
          <td class="paramname"> <em>orientation</em> = <code><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/namespaceWt.html#2a8d45559e16a0185bf61bfad0a67912c2ebf22b096a22b18eef23e736aa2e28">Wt::Horizontal</a></code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>role</em> = <code><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/group__modelview.html#gg0ae864e12320f9f89172735e075ed0685ed17aded8a0e3b712698cf85a218f1f">Wt::DisplayRole</a></code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns header data. 
<p>

<p>Reimplemented from <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WAbstractItemModel.html#86bbab7c809fce4de9b5cb543b2fb124">Wt::WAbstractItemModel</a>.</p>

<p>Definition at line <a class="el" href="GitModel_8C-source.html#l00164">164</a> of file <a class="el" href="GitModel_8C-source.html">GitModel.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00166"></a>00166 {
<a name="l00167"></a>00167   <span class="keywordflow">if</span> (orientation == Horizontal &amp;&amp; role == <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/group__modelview.html#gg0ae864e12320f9f89172735e075ed0685ed17aded8a0e3b712698cf85a218f1f">DisplayRole</a>)
<a name="l00168"></a>00168     <span class="keywordflow">return</span> <span class="stringliteral">"File"</span>;
<a name="l00169"></a>00169   <span class="keywordflow">else</span>
<a name="l00170"></a>00170     <span class="keywordflow">return</span> boost::any();
<a name="l00171"></a>00171 }
</pre></div>
<p>

</div>
</div><p>
<a class="anchor" name="b2efe3ae663dfbd670dc41dd3cb8d2a0"></a><!-- doxytag: member="GitModel::getTreeId" ref="b2efe3ae663dfbd670dc41dd3cb8d2a0" args="(int parentId, int childIndex) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int GitModel::getTreeId           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>parentId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>childIndex</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td> const<code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get or allocate an id for a folder. 
<p>
The folder is identified by a given childIndex within a parent folder. This method adds data to the treeData_ (and childPointer_) data structures. 
<p>Definition at line <a class="el" href="GitModel_8C-source.html#l00076">76</a> of file <a class="el" href="GitModel_8C-source.html">GitModel.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00077"></a>00077 {
<a name="l00078"></a>00078   ChildIndex <a class="code" href="classGitModel.html#47f5ebf88be96b003b4bf31bfafff141" title="Returns a child index.">index</a>(parentId, childIndex);
<a name="l00079"></a>00079 
<a name="l00080"></a>00080   ChildPointerMap::const_iterator i = <a class="code" href="classGitModel.html#4f3e07cf6dddd098c4c4f0978be0fe90" title="Maps child indexes to tree indexes.">childPointer_</a>.find(<a class="code" href="classGitModel.html#47f5ebf88be96b003b4bf31bfafff141" title="Returns a child index.">index</a>);
<a name="l00081"></a>00081   <span class="keywordflow">if</span> (i == <a class="code" href="classGitModel.html#4f3e07cf6dddd098c4c4f0978be0fe90" title="Maps child indexes to tree indexes.">childPointer_</a>.end()) {
<a name="l00082"></a>00082     <span class="comment">// no tree object was already allocated, so do that now.</span>
<a name="l00083"></a>00083 
<a name="l00084"></a>00084     <span class="comment">// lookup the git SHA1 object Id (within the parent)</span>
<a name="l00085"></a>00085     <span class="keyword">const</span> Tree&amp; parentItem = <a class="code" href="classGitModel.html#59307dfceb1f5712914e0754144422e4" title="List of folder objects.">treeData_</a>[parentId];
<a name="l00086"></a>00086     <a class="code" href="structGit_1_1Object.html" title="Git object.">Git::Object</a> o = <a class="code" href="classGitModel.html#fc8ff43e47ae51ce2af04d63a162be8e" title="The git repository.">git_</a>.<a class="code" href="classGit.html#910f3a6123b494897cdedf7ba4ef648b" title="Get some info on a tree object.">treeGetObject</a>(parentItem.treeObject(), childIndex);
<a name="l00087"></a>00087 
<a name="l00088"></a>00088     <span class="comment">// and add to treeData_ and childPointer_ data structures</span>
<a name="l00089"></a>00089     <a class="code" href="classGitModel.html#59307dfceb1f5712914e0754144422e4" title="List of folder objects.">treeData_</a>.push_back(Tree(parentId, childIndex, o.<a class="code" href="structGit_1_1Object.html#2e3989983524516e4a936714b55736ff">id</a>));
<a name="l00090"></a>00090     <span class="keywordtype">int</span> result = <a class="code" href="classGitModel.html#59307dfceb1f5712914e0754144422e4" title="List of folder objects.">treeData_</a>.size() - 1;
<a name="l00091"></a>00091     <a class="code" href="classGitModel.html#4f3e07cf6dddd098c4c4f0978be0fe90" title="Maps child indexes to tree indexes.">childPointer_</a>[<a class="code" href="classGitModel.html#47f5ebf88be96b003b4bf31bfafff141" title="Returns a child index.">index</a>] = result;
<a name="l00092"></a>00092     <span class="keywordflow">return</span> result;
<a name="l00093"></a>00093   } <span class="keywordflow">else</span>
<a name="l00094"></a>00094     <span class="keywordflow">return</span> i-&gt;second;
<a name="l00095"></a>00095 }
</pre></div>
<p>

</div>
</div><p>
<a class="anchor" name="0eec46284e84c7deeb1a39eb7185d1d1"></a><!-- doxytag: member="GitModel::getObject" ref="0eec46284e84c7deeb1a39eb7185d1d1" args="(const Wt::WModelIndex &amp;index) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structGit_1_1Object.html">Git::Object</a> GitModel::getObject           </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html">Wt::WModelIndex</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>index</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get the <a class="el" href="structGit_1_1Object.html" title="Git object.">Git::Object</a> that corresponds to an index. 
<p>

<p>Definition at line <a class="el" href="GitModel_8C-source.html#l00173">173</a> of file <a class="el" href="GitModel_8C-source.html">GitModel.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00174"></a>00174 {
<a name="l00175"></a>00175   <span class="keywordtype">int</span> parentId = index.<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html#f0fedac552dfeb6162f10d26d0876c85">internalId</a>();
<a name="l00176"></a>00176   <span class="keyword">const</span> Tree&amp; parentItem = <a class="code" href="classGitModel.html#59307dfceb1f5712914e0754144422e4" title="List of folder objects.">treeData_</a>[parentId];
<a name="l00177"></a>00177   <span class="keywordflow">return</span> <a class="code" href="classGitModel.html#fc8ff43e47ae51ce2af04d63a162be8e" title="The git repository.">git_</a>.<a class="code" href="classGit.html#910f3a6123b494897cdedf7ba4ef648b" title="Get some info on a tree object.">treeGetObject</a>(parentItem.treeObject(), index.<a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WModelIndex.html#a4f1385223391c46ee200a57672f6046">row</a>());
<a name="l00178"></a>00178 }
</pre></div>
<p>

</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="49c30024f0241738b30cf4cec589b292"></a><!-- doxytag: member="GitModel::ContentsRole" ref="49c30024f0241738b30cf4cec589b292" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const int <a class="el" href="classGitModel.html#49c30024f0241738b30cf4cec589b292">GitModel::ContentsRole</a> = <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/group__modelview.html#gg0ae864e12320f9f89172735e075ed0689b7eae9fc07ea4fd8afe7bc97954162c">Wt::UserRole</a><code> [static]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
The role which may be used on a file to retrieve its contents. 
<p>

<p>Definition at line <a class="el" href="GitModel_8h-source.html#l00041">41</a> of file <a class="el" href="GitModel_8h-source.html">GitModel.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="9419f872ce68506009748f0595400ef7"></a><!-- doxytag: member="GitModel::FilePathRole" ref="9419f872ce68506009748f0595400ef7" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const int <a class="el" href="classGitModel.html#9419f872ce68506009748f0595400ef7">GitModel::FilePathRole</a> = <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/group__modelview.html#gg0ae864e12320f9f89172735e075ed0689b7eae9fc07ea4fd8afe7bc97954162c">Wt::UserRole</a> + 1<code> [static]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Definition at line <a class="el" href="GitModel_8h-source.html#l00042">42</a> of file <a class="el" href="GitModel_8h-source.html">GitModel.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="fc8ff43e47ae51ce2af04d63a162be8e"></a><!-- doxytag: member="GitModel::git_" ref="fc8ff43e47ae51ce2af04d63a162be8e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classGit.html">Git</a> <a class="el" href="classGitModel.html#fc8ff43e47ae51ce2af04d63a162be8e">GitModel::git_</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
The git repository. 
<p>

<p>Definition at line <a class="el" href="GitModel_8h-source.html#l00106">106</a> of file <a class="el" href="GitModel_8h-source.html">GitModel.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="59307dfceb1f5712914e0754144422e4"></a><!-- doxytag: member="GitModel::treeData_" ref="59307dfceb1f5712914e0754144422e4" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::vector&lt;<a class="el" href="classGitModel_1_1Tree.html">Tree</a>&gt; <a class="el" href="classGitModel.html#59307dfceb1f5712914e0754144422e4">GitModel::treeData_</a><code> [mutable, private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
List of folder objects. 
<p>
This list contains folders for which a model index has been allocated.<p>
Model indexes have an internal id that are indexes into this vector, identifying the folder that contains a particular file.<p>
Note: only for folders this is needed, since files will never be used as a 'parent' index.<p>
It is populated on-the-fly, as the user navigates the model. 
<p>Definition at line <a class="el" href="GitModel_8h-source.html#l00175">175</a> of file <a class="el" href="GitModel_8h-source.html">GitModel.h</a>.</p>

</div>
</div><p>
<a class="anchor" name="4f3e07cf6dddd098c4c4f0978be0fe90"></a><!-- doxytag: member="GitModel::childPointer_" ref="4f3e07cf6dddd098c4c4f0978be0fe90" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classGitModel.html#5bdd5d3dea3e158889afc795b455d103">ChildPointerMap</a> <a class="el" href="classGitModel.html#4f3e07cf6dddd098c4c4f0978be0fe90">GitModel::childPointer_</a><code> [mutable, private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Maps child indexes to tree indexes. 
<p>
This map provides a way to lookup data in treeData_. It has an entry corresponding to every entry in treeData_: it maps child indexes for folders to indexes in the treeData_ vector.<p>
It is populated on-the-fly, as the user navigates the model. 
<p>Definition at line <a class="el" href="GitModel_8h-source.html#l00185">185</a> of file <a class="el" href="GitModel_8h-source.html">GitModel.h</a>.</p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following files:<ul>
<li>/home/koen/project/wt/public-git/wt/examples/gitmodel/<a class="el" href="GitModel_8h-source.html">GitModel.h</a><li>/home/koen/project/wt/public-git/wt/examples/gitmodel/<a class="el" href="GitModel_8C-source.html">GitModel.C</a></ul>
</div>
<hr size="1"><address style="align: right;"><small>
Generated on Fri Mar 26 17:12:12 2010 for <a href="http://www.webtoolkit.eu/wt/">Wt</a> by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6</small></address>
</body>
</html>