@@ -229,6 +229,114 @@ genMarkdown(
229
229
writeDescription (C, os);
230
230
}
231
231
232
+ // ------------------------------------------------
233
+
234
+ namespace adoc {
235
+
236
+ template <class T >
237
+ class list
238
+ {
239
+ T const & t_;
240
+
241
+ public:
242
+ explicit
243
+ list (T const & t) noexcept
244
+ : t_(t)
245
+ {
246
+ }
247
+
248
+ friend
249
+ llvm::raw_ostream&
250
+ operator <<(
251
+ llvm::raw_ostream& os,
252
+ T const & t)
253
+ {
254
+ os <<
255
+ " [cols=2]\n " <<
256
+ " |===\n " ;
257
+
258
+ if (t.empty ())
259
+ {
260
+ os <<
261
+ " |===\n "
262
+ " \n " ;
263
+ return os;
264
+ }
265
+ }
266
+ };
267
+
268
+ } // adoc
269
+
270
+ // ------------------------------------------------
271
+
272
+ // ------------------------------------------------
273
+ //
274
+ // Functions
275
+ //
276
+ // ------------------------------------------------
277
+
278
+ void
279
+ listFunctions (
280
+ ClangDocContext const & CDCtx,
281
+ llvm::StringRef label,
282
+ mrdox::Functions const & v,
283
+ llvm::raw_ostream& os)
284
+ {
285
+ if (v.empty ())
286
+ return ;
287
+
288
+ section (label, 2 , os);
289
+ os <<
290
+ " [cols=2]\n " <<
291
+ " |===\n " <<
292
+ " |Name\n " <<
293
+ " |Description\n " <<
294
+ " \n " ;
295
+ os <<
296
+ " |`" << v.front ().name << " `\n " <<
297
+ " | brief \n " ;
298
+ for (std::size_t i = 1 ; i < v.size (); ++i)
299
+ {
300
+ auto const & f = v[i];
301
+ os <<
302
+ " \n " <<
303
+ " |`" << f.name << " `\n " <<
304
+ " | brief \n " ;
305
+ }
306
+ os <<
307
+ " |===\n " <<
308
+ " \n " ;
309
+ }
310
+
311
+ void
312
+ listFunctions (
313
+ ClangDocContext const & CDCtx,
314
+ llvm::StringRef label,
315
+ mrdox::ScopedFunctions const & fns,
316
+ llvm::raw_ostream& os)
317
+ {
318
+ listFunctions (
319
+ CDCtx,
320
+ " Public Functions" ,
321
+ fns.overloads [clang::AccessSpecifier::AS_public],
322
+ os);
323
+ listFunctions (
324
+ CDCtx,
325
+ " Protected Functions" ,
326
+ fns.overloads [clang::AccessSpecifier::AS_protected],
327
+ os);
328
+ listFunctions (
329
+ CDCtx,
330
+ " Private Functions" ,
331
+ fns.overloads [clang::AccessSpecifier::AS_private],
332
+ os);
333
+ listFunctions (
334
+ CDCtx,
335
+ " Functions" ,
336
+ fns.overloads [clang::AccessSpecifier::AS_none],
337
+ os);
338
+ }
339
+
232
340
// ------------------------------------------------
233
341
//
234
342
// FunctionInfo
@@ -382,23 +490,30 @@ genMarkdown(
382
490
writeNewLine (os);
383
491
}
384
492
385
- if (!I.Children .Records .empty ())
493
+ if ( ! I.Children .Records .empty () ||
494
+ ! I.Children .Typedefs .empty ())
386
495
{
387
496
section (" Types" , 2 , os);
388
- for (const auto & R : I.Children .Records ) {
497
+ for (const auto & R : I.Children .Records )
498
+ {
389
499
os << " * " ;
390
500
writeNameLink (BasePath, R, os);
391
501
os << " \n " ;
392
502
}
503
+ for (const auto & R : I.Children .Typedefs )
504
+ os << " * " << R.Name << " \n " ;
393
505
writeNewLine (os);
394
506
}
395
507
396
- listFunctions (CDCtx, " Functions" , I.Children .Functions , os);
508
+ listFunctions (CDCtx, " Functions" , I.Children .functions , os);
509
+ // listFunctions(CDCtx, "Functions", I.Children.Functions, os);
397
510
511
+ #if 0
398
512
for(auto const& fi : I.Children.Functions)
399
513
{
400
514
emitFunction(CDCtx, fi, os);
401
515
}
516
+ #endif
402
517
403
518
if (!I.Children .Enums .empty ()) {
404
519
section (" Enums" , 2 , os);
@@ -474,7 +589,7 @@ genMarkdown(
474
589
475
590
// VFALCO STATIC MEMBER FUNCTIONS
476
591
477
- listFunctions (CDCtx, " Member Functions" , I.Children .Functions , os);
592
+ listFunctions (CDCtx, " Member Functions" , I.Children .functions , os);
478
593
479
594
if (!I.Children .Enums .empty ())
480
595
{
0 commit comments