Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • vtk/vtk
  • brad.king/vtk
  • allisonvacanti/vtk
  • chuck.atkins/vtk
  • shawn.waldon/vtk
  • robertmaynard/vtk
  • gcasey/vtk
  • danlipsa/vtk
  • sankhesh/vtk
  • nix/vtk
  • utkarsh.ayachit/vtk
  • seanm/vtk
  • amaclean/vtk
  • lorensen/vtk
  • dgobbi/vtk
  • jpouderoux/vtk
  • ken-martin/vtk
  • ben.boeckel/vtk
  • karsten.tausche/vtk
  • jbeezley/vtk
  • demarle/vtk
  • karasevpa/vtk
  • sebastien.jourdain/vtk
  • will.schroeder/vtk
  • pixelstime/vtk
  • sujin.philip/vtk
  • acbauer/vtk
  • berkgeveci/vtk
  • cory.quammen/vtk
  • john.tourtellott/vtk
  • jcfr/vtk
  • tcoulange/vtk
  • finetjul/vtk
  • aashish-chaudhary/vtk
  • tadeu/vtk
  • bxa/vtk
  • clinton/vtk
  • cjh1/vtk
  • alextsui05/vtk
  • jorge.suit/vtk
  • mwestphal/vtk
  • arnaudgelas/vtk
  • splines/vtk
  • dcthomp/spline-vtk
  • Lin.Ma/vtk-spline
  • matt-mccormick/vtk
  • ndfabian/vtk
  • scott.wittenburg/vtk
  • bill-hoffman/vtk
  • dlrdave/vtk
  • ethanb/vtk
  • johan-andruejol/vtk
  • ashray/vtk
  • Toki/vtk
  • kimbaol/vtk
  • toster/vtk
  • applekey/vtk
  • quantumsteve/vtk
  • a_neeman/vtk
  • biddisco/vtk
  • mhanwell/vtk
  • jjomier/vtk
  • dkuegler/vtk
  • bobifx/vtk
  • yordan_kyosev/vtk
  • schuyler.kylstra/vtk
  • ilya-five/vtk
  • JimCosby/vtk
  • Geng/vtk
  • blessley/vtk
  • davisb/vtk
  • iMSTK/vtk
  • chunmingchen/vtk
  • danlugli/vtk
  • chaffra/vtk
  • tjcorona/vtk
  • mennodeij1/vtk
  • thehummingbird/vtk
  • prabhuramachandran/vtk
  • chiranjibsur/vtk
  • jwilliz/vtk
  • wydesenej/vtk
  • msmolens/vtk
  • Lin.Ma/vtk
  • joseph.g.hennessey2.ctr/vtk
  • Wu/vtk
  • rogerkint/vtk
  • Xabi/vtk
  • timt/vtk
  • dcthomp/vtk
  • carson/vtk
  • Niels_Dekker/vtk
  • dmsurti/vtk
  • shreejan/vtk
  • brudfors/vtk
  • yumin/vtk
  • bob.obara/vtk
  • cousin_it/vtk
  • fstrati/vtk
  • dzenanz/vtk
  • cdeepakroy/vtk
  • LucasGandelKitware/vtk
  • alexis-girault/vtk
  • sreekanth-arikatla/vtk
  • SumedhaSingla/vtk
  • ricardo-ortiz/vtk
  • yboumenir/vtk
  • alvaro.sanchez/vtk
  • jgoizueta/vtk
  • bloring/vtk
  • akhilsurabhi/vtk
  • appstonic/vtk
  • waldyrious/vtk
  • lenlen/vtk
  • romangrothausmann/vtk
  • NevilX/vtk
  • natorious1990/vtk
  • ktsumura/vtk
  • radix-vinni/vtk
  • saumyabhadani/vtk
  • starius/vtk
  • mgenet/vtk
  • dhanannjay-deo/vtk
  • fabian.wenzel/vtk
  • stephenshamilton/vtk
  • axkibe/vtk
  • grlee77/vtk
  • lisa-avila/vtk
  • martyngigg/vtk
  • asmith/vtk
  • opoplawski/vtk
  • maxoox/vtk
  • estan/vtk
  • awehrfritz/vtk
  • dsgruss/vtk
  • abheekg/vtk
  • jfavre/vtk
  • updega2/vtk
  • dgraves/vtk
  • zaherabdulazeez/vtk
  • lisphacker/vtk
  • BillMcGrory/vtk
  • Yang/vtk
  • dumontal/vtk
  • DVigneault/vtk
  • xyjin213/vtk
  • cpatrick/vtk
  • isohatalaj/vtk
  • rete/vtk
  • polycorn/vtk
  • Promayon/vtk
  • karthik/vtk
  • betsy.mcphail/vtk
  • nschloe/vtk
  • kmorel/vtk
  • aniqah/vtk
  • rupertnash/vtk
  • iMichka/vtk
  • shru13448/vtk
  • aeslaughter/vtk
  • QuadmasterXLII1/vtk
  • QuadmasterXLII/vtk
  • haocheng.liu/vtk
  • LouisBergmann/vtk
  • alouis/vtk
  • bjacquet/vtk
  • pieper/vtk
  • Ychuan1115/vtk
  • srikanthnagella/vtk
  • SeunOdutola/vtk
  • jborck/vtk
  • sidd23295/vtk
  • besoft/vtk
  • imikejackson/vtk
  • tttanichka333/vtk
  • vromerocano/vtk
  • fogleman/vtk
  • hinashah/vtk
  • abhishekns/vtk
  • mpkh/vtk
  • borisb/vtk
  • eg/vtk
  • technic/vtk
  • chet.nieter/vtk
  • maleike/vtk
  • emmenlau/vtk
  • florianlink1/vtk
  • teracamo/vtk
  • ole.v.solberg/vtk
  • greenjava/vtk
  • snorrikris/vtk
  • HaipengY/vtk
  • hina/vtk
  • jhlegarreta/vtk
  • diorcety/vtk
  • taketwo/vtk
  • mnucci32/vtk
  • gnzlbg/vtk
  • dfroger/vtk
  • WimK/vtk
  • luciemacron/vtk
  • kd7uns/vtk
  • dgkf/vtk
  • gocarlos/vtk
  • jayas121/vtk
  • olesen/vtk
  • Jon_Garner/vtk
  • cschmitz/vtk
  • Paul/vtk
  • kaaalid/vtk
  • neiltwist/vtk
  • Hertz1239/vtk
  • jupiterben/vtk
  • pierre.guilbert/vtk
  • matthew-woehlke/vtk
  • xantares/vtk
  • mayeul.chassagnard/vtk
  • t-ikegami/vtk
  • gbivins4/vtk
  • jacob/vtk
  • sarahjelinek/vtk
  • nicolas.vuaille/vtk
  • art/vtk
  • Levinaz69/vtk
  • aron.helser/vtk
  • yohey/vtk
  • alex-novinski/vtk
  • jacob-becker/vtk
  • robbie_lxw/vtk
  • burhan14031/vtk
  • thewtex/vtk
  • ML/vtk
  • bilke/vtk
  • bvanelli/vtk
  • Juliano/vtk
  • luliag/vtk
  • muellni/vtk
  • barkinet/vtk
  • kvankooten/vtk
  • Moonypoony/vtk
  • derino/vtk
  • wendy/vtk
  • kekivelez/vtk
  • Archeks/vtk
  • claireguilbaud/vtk
  • lassoan/vtk
  • brunbennett/vtk
  • hcwiley/vtk
  • jie.cheng/vtk
  • kghandi/vtk
  • michalhabera/vtk
  • francis.giraldeau/vtk
  • GG1991/vtk
  • ugiwgh/vtk
  • benjaminjeliot/vtk
  • locuscaeruleus/vtk
  • marcelotrevisani/vtk
  • Punzo/vtk
  • pavelpokutnev/vtk
  • sylmarien/vtk
  • jbvimort/vtk
  • athius/vtk
  • aowen87/vtk
  • StefanBruens/vtk
  • nocnokneo/vtk
  • mds/vtk
  • forrest.li/vtk
  • rcfwgithub/vtk
  • Guenoleh/vtk
  • drmateo/vtk
  • ahota/vtk
  • nishanthkarthik/vtk
  • pdhahn/vtk
  • dyoll/vtk
  • todoooo/vtk
  • Rhodanos/vtk
  • bjoernthiel/vtk
  • pink2/vtk
  • thudacko/vtk
  • qwofford/vtk
  • michael.migliore/vtk
  • mohamedAhmedIsmailAhmed/vtk
  • m-chaturvedi/vtk
  • Shoepon/vtk
  • ricardomorello/vtk
  • ktsai/vtk
  • hjmjohnson/vtk
  • daseven/vtk
  • federico.miorelli/vtk
  • jianfulin/vtk
  • ihnorton/vtk
  • handrake0724/vtk
  • yuelinho777/vtk
  • eberroca/vtk
  • arankin/vtk
  • zachmullen/vtk
  • alzi/vtk
  • csukuangfj/vtk
  • nick.laurenson/vtk
  • ethan.stam/vtk
  • bujack/vtk
  • ifmfr/vtk
  • jpulido/vtk
  • Butakoff/vtk
  • innokentiy.alaytsev/vtk
  • hendersa/vtk
  • tkarabela/vtk
  • charly.girot/vtk
  • dbonhaus/vtk
  • ClundXIII/vtk
  • shaikan/vtk
  • timrowley/vtk
  • tomj/vtk
  • ombre5733/vtk
  • hbwhlk83/vtk
  • cpinter/vtk
  • fbudin/vtk
  • nehaljwani/vtk
  • CometS1/vtk
  • debian/vtk
  • jan.o.schutte/vtk
  • normanius/vtk
  • wehhh/vtk
  • bwspenc/vtk
  • sergioPereiraBR/vtk
  • yurivict/vtk
  • GarrettMorrison/vtk
  • jensgw/vtk
  • alesgenova/vtk
  • paulharris/vtk
  • niranjankala/vtk
  • tavaughan/vtk
  • christianezeani/vtk
  • kihneman/vtk
  • phcerdan/vtk
  • Bengt/vtk
  • knolla/vtk
  • shreeraj.jadhav/vtk
  • Sunderlandkyl/vtk
  • drpeterfranz/vtk
  • pedroneto/vtk
  • levara/vtk
  • TheBlackCat/vtk
  • Bleach665/vtk
  • JeromeDuboisPro/vtk
  • pbergeron/vtk
  • ilovezfs/vtk
  • jeffamstutz/vtk
  • edwinbennink/vtk
  • ChrisB/vtk
  • rexchai/vtk
  • jclearwater/vtk
  • pengzhou93/vtk
  • Cotrik/vtk
  • drouin-simon/vtk
  • Simon-GitLab/vtk
  • mcvaneede/vtk
  • aaigner/vtk
  • murraypurves/vtk
  • Chrisyunhua/vtk
  • lhofmann/vtk
  • tobias-haenel/vtk
  • aitormoreno/vtk
  • severnaa/vtk
  • angelika.ophagen/vtk
  • AOphagen/vtk
  • byhongda/vtk
  • HuangLiJinJames/vtk
  • NicholasWon47/vtk
  • chenhaomagnetic/vtk
  • imngy/vtk
  • maxGimeno/vtk
  • kf6kjg/vtk
  • cstew2/vtk
  • lrineau/vtk
  • vnpavanelli/vtk
  • erichlf/vtk
  • SunBlack/vtk
  • PauloCarvalhoRJ/vtk
  • McrmDev/vtk
  • jblekien/vtk
  • guerrero78/vtk
  • hygonsoc/vtk
  • embeddedmz/vtk
  • wangtaoz/vtk
  • andrea-iob/vtk
  • ollielo/vtk
  • boonth/vtk
  • lugia-kun/vtk
  • adrien.boucaud/vtk
  • jstark/vtk
  • mathiash/vtk
  • patrick-oleary/vtk
  • patchett2002/vtk
  • tbiedert/vtk
  • MITRALZ/vtk
  • shihabrus/vtk
  • Xaxetrov/vtk
  • charles.gueunet/vtk
  • edern.haumont/vtk
  • schweitzer/vtk
  • leonhardt/vtk
  • williamfgc/vtk
  • hococoder/vtk
  • barcharcraz/vtk
  • lcantell/vtk
  • matt.leotta/vtk
  • kairong.jiang/vtk
  • neohsbrother/vtk
  • animeshbaranawal/vtk
  • jdoenias/vtk
  • bmwiedemann/vtk
  • stephen.sanchez/vtk
  • kislinsk/vtk
  • yufeimi/vtk
  • milljm/vtk
  • zmj1316/vtk
  • zhuokaizhao/vtk
  • nghia.truong/vtk
  • Mycai/vtk
  • Jacques-Bernard/vtk
  • yohann.bearzi/vtk
  • nghiatruong.vn/vtk
  • caitlin.ross/vtk
  • aandreyev/vtk
  • robustwangace/vtk
  • kovtuh/vtk
  • paulyc/vtk
  • pronaman/vtk
  • huyidao625/vtk
  • EvgenyVRN/vtk
  • yale.lee_nga/vtk
  • cobo/vtk
  • Highphone110/vtk
  • kevin.tew/vtk
  • daniel.jasinski/vtk
  • aspsee/vtk
  • Jellby/vtk
  • Bo98/vtk
  • tkoyama010/vtk
  • keith.m.ballard/vtk
  • XinhuaZhang/vtk
  • Simon-Esneault/vtk
  • maximilian.reimer.42/vtk
  • florian360/vtk
  • patrick.avery/vtk
  • aglv/vtk
  • mat127/vtk
  • brad-t-moore/vtk
  • thompson318/vtk
  • kingyue737/vtk
  • gilcu2/vtk
  • shogarth/vtk
  • doktorkjeld/vtk
  • BuzzBurrowes/vtk
  • amine.aboufirass/vtk
  • kirv/vtk
  • westphalm/vtk
  • gerald.lodron/vtk
  • yhtank/vtk
  • paul.lafoix/vtk
  • KiraGabi/vtk
  • ralovich/vtk
  • s.jafari.m/vtk
  • richardc/vtk
  • larsoner/vtk
  • DavidLaidlaw/vtk
  • thibault.pelletier/vtk
  • dhanakoti.murali/vtk
  • vbolea/vtk
  • aravind90/vtk
  • martijnkoopman/vtk
  • Tiphainejh/vtk
  • yozara/vtk
  • NicolaasWeideman/vtk
  • fdepourcq/vtk
  • Eustache/vtk
  • mdaley/vtk
  • aangelos28/vtk
  • RaoGY/vtk
  • sthibaul/vtk
  • qyr3366/vtk
  • ChristophHonal/vtk
  • christos.tsolakis/vtk
  • Cool/vtk
  • hansuk/vtk
  • mdorier/vtk
  • nerdalien/vtk
  • yasushi.saito/vtk
  • paul.choisel/vtk
  • kovynev/vtk
  • bobmiller/vtk
  • ziqiangxu/vtk
  • gonzalosaezm55/vtk
  • SailCPU/vtk
  • woodbot/vtk
  • yufan/vtk
  • amelvill-umich/vtk
  • mossaiby/vtk
  • likehuaer/vtk
  • timothee.chabat/vtk
  • Senidenary/vtk
  • Tobias-Fischer/vtk
  • BrentFoster/vtk
  • thliebig/vtk
  • thomas.caissard/vtk
  • whophil/vtk
  • RafaelPalomar/vtk
  • Angelo-abel/vtk
  • shawfei/vtk
  • MattesSchu/vtk
  • guillaume.gindre/vtk
  • maack/vtk
  • zqcolorful/vtk
  • tniemi/vtk
  • imalkov82/vtk
  • bzindovic/vtk
  • v.engelgardt/vtk
  • mjjackey/vtk
  • halowine/vtk
  • laurenn.lam/vtk
  • zonghx/vtk
  • ProGamerCode/vtk
  • bp85540/vtk
  • julia.sanchez/vtk
  • melanie.carriere/vtk
  • jules.bourdais/vtk
  • jerome.dias/vtk
  • luca.lacaille/vtk
  • octave.rossi/vtk
  • c.wetterer-nelson/vtk
  • nima.tofighi/vtk
  • jspanchu/vtk
  • jsteele/vtk
  • PetiteViking/vtk
  • bart/vtk
  • LucasGasparinoBSC/vtk
  • julien2412/vtk
  • francois.mazen/vtk
  • lxgwd1983/vtk
  • timothee.couble/vtk
  • benntqoo/vtk
  • jmhawkins/vtk
  • stonej/vtk
  • JackGuyver/vtk
  • rodrigomologni/vtk
  • chart3388/vtk
  • jessica.marquis/vtk
  • rockandsalt/vtk
  • zakaria220/vtk
  • ryan.krattiger1/vtk
  • darktemplarbasealt/vtk
  • scbiradar/vtk
  • andrew.wilson/vtk
  • moritz-h/vtk
  • kyzitemelos93/vtk
  • qqzhoucn/vtk
  • laurent.malka/vtk
  • akaszynski/vtk
  • spiros.tsalikis/vtk
  • sercxjo/vtk
  • jesper.norell/vtk
  • tiffany.chhim/vtk
  • jennifermanzella11/vtk
  • loongson-zn/vtk
  • RonRahaman/vtk
  • Snethy/vtk
  • antoine.ruffion/vtk
  • air-h-128k-il/vtk
  • atomicky/vtk
  • chenjt2001/vtk
  • cclauss/vtk
  • Connor-Bowley/vtk
  • ferdymercury/vtk
  • connor.bowley/vtk
  • Tianyang86/vtk
  • stephen.crowell/vtk
  • xzhang/vtk
  • antoine.schieb/vtk
  • ArchangeGabriel/vtk
  • thomas.galland/vtk
  • kadabraqc/vtk
  • sanguinariojoe/vtk
  • tom.suchel/vtk
  • mgoodson-cvd/vtk
  • jtojnar/vtk
  • bwoodsend/vtk
  • frantze.raphael/vtk
  • YuhaoQiu/vtk
  • user-zmt/vtk
  • XiaLiChao82/vtk
  • biagas/vtk
  • gaspard.thevenon/vtk
  • nicoco/vtk
  • svenevs/vtk
  • olesalscheider/vtk
  • EvanHampton-Seequent/vtk
  • spsjorspeterse/vtk
  • p-j-smith/vtk
  • jaswant.panchumarti/vtk
  • nasos/vtk
  • david.berger/vtk
  • dmt/vtk
  • huangjx-beijing/vtk
  • andtokm/vtk
  • MehdiChinoune/vtk
  • alexy.pellegrini/vtk
  • lucas.givord/vtk
  • jianhui2769/vtk
  • chengchengjing/vtk
  • scienceasdf/vtk
  • maidamai0/vtk
  • GuillaumeFavelier/vtk
  • ayenpure/vtk
  • ikerssm/vtk
  • hakostra/vtk
  • epalmer/vtk
  • Dophi123/vtk
  • julien.fausty/vtk
  • zjibben/vtk
  • nncarlson/vtk
  • Simon96128/vtk
  • jiapei1001/vtk
  • jiapei100/vtk
  • Failxxx/vtk
  • jcorbettfrank/vtk
  • Xingorno/vtk
  • windgs/vtk
  • orbisvicis/vtk
  • jramaiah/vtk
  • luzpaz/vtk
  • kammnd/vtk
  • lokessh/vtk
  • QinChen1998/vtk
  • mirenradia/vtk
  • tbirdso/vtk
  • jones/vtk
  • HollowSun/vtk
  • db/vtk
  • matthiasbock/vtk
  • adam-grant-hendry/vtk
  • Kenichiro-Yoshimi/vtk
  • redemptorridon/vtk
  • Neumann-A/vtk
  • tereshkinvadimst/vtk
  • francorougier60/vtk
  • felixonmars/vtk
  • gabrielmuller/vtk
  • Alex9/vtk
  • XinweiHsu/vtk
  • Zz-er/vtk
  • ferdnyc/vtk
  • mahmoudmohamedk8200949/vtk
  • HamsaSaber/vtk
  • boomanaiden154/vtk
  • bebuch/vtk
  • fab/vtk
  • chrisadamsonmcri/vtk
  • yarous224/vtk
  • zhenhaochu/vtk
  • pranjal.sahu/vtk
  • thibault.bruyere/vtk
  • banesullivan/vtk
  • is0591hs/vtk
  • philipp.weissenbacher/vtk
  • xavier.tricoche/vtk
  • hopfer.benjamin/vtk
  • liyinyan/vtk
  • gabriel.lefloch/vtk
  • bistek/vtk
  • mmXIO/vtk
  • MicK7/vtk
  • jndxljun/vtk
  • Shirin_ra/vtk
  • hanfengyu/vtk
  • zhhaoyuting111/vtk
  • john-stone/vtk
  • woosukbyun0724/vtk
  • xenosLit/vtk
  • ashishmalik5am/vtk
  • j824h/vtk
  • jschueller/vtk
  • alexdewar/vtk
  • mo.gomaa1996/vtk
  • rubendebruin/vtk
  • CiaoTan/vtk
  • bhaq-tri/vtk
  • TattiRuby/vtk
  • griffin28/vtk
  • he.wryyy/vtk
  • aly.tireira/vtk
  • Riaa/vtk
  • b89alireza/vtk
  • john.parent/vtk
  • marin.kajtazi/vtk
  • andy9t7/vtk
  • mikedubb0811/vtk
  • kookoo9999/vtk
  • charly.bollinger/vtk
  • kamm1948/vtk
  • jacob.moore/vtk
  • gaoxinyu18/vtk
  • zhouyi-u/vtk
  • Robbie/vtk
  • couletj/vtk
  • julien.chaize1/vtk
  • shreeni152/vtk
  • lkaly/vtk
  • louis.gombert/vtk
  • linneapalmstrom/vtk
  • ppebay/vtk
  • Rocky/vtk
  • jiangxingkai/vtk
  • xutang/vtk
  • jens.munk.hansen/vtk
  • 5268368/vtk
  • jumbojing/vtk
  • vectorD/vtk
  • mo-schmid/vtk
  • CC9701/vtk
  • Diiiiii-9/vtk
  • moussa-li/vtk
  • MatthewFlamm/vtk
  • sergeylesnik/vtk
  • xpnguyen/vtk
  • FireFlyUh/vtk
  • klevzoff/vtk
  • jake.yun/vtk
  • ixxi/vtk
  • stavbodik/vtk
  • willdunklin/vtk
  • hjhicks321/vtk
  • ymao.mu/vtk
  • fghoussen/vtk
  • Otahal/vtk
  • OccupyMars2025/vtk
  • dglaeser/vtk
  • Skyde/vtk
  • rbinyahib/vtk
  • jmisedam/vtk
  • petlenz/vtk
  • nmnobre/vtk
  • mheinsen/vtk
  • LimitingFactor/vtk
  • Senguo/vtk
  • lee.newberg/vtk
  • svniemeijer/vtk
  • alfiogn/vtk
  • 2xB/vtk
  • karamozianalireza1010/vtk
  • astucky/vtk
  • penfe/vtk
  • lgombert/vtk
  • saichaitanya.rodda/vtk
  • thaumaturg1c/vtk
  • pkestene/vtk
  • rlexmann/vtk
  • gabokamaze/vtk
  • 212dandan/vtk
  • dinghao19960829/vtk
  • ScarpMarc/vtk
  • yangdonglai/vtk
  • stauffert.maxime/vtk
  • dyollb/vtk
  • hollowsunhc/vtk
  • loic.gaillard/vtk
  • ychaos/vtk
  • dperozzi/vtk
  • SeanCurtis-TRI/vtk
  • jhodges/vtk
  • jingliang2005/vtk
  • hbwhzc/vtk
  • zellmann/vtk
  • germa89/vtk
  • 2nafish117/vtk
  • uporersith/vtk
  • jordi.subirana/vtk
  • carlosgcolon/vtk
  • PeterFranzSeequent/vtk
  • cristianAnd24/vtk
  • mrbean-bremen/vtk
  • usiems/vtk
  • Krzmbrzl/vtk
  • tom.clabault/vtk
  • dpseiter1/vtk
  • scivision/vtk
  • Donvlouss/vtk
  • fedormsv/vtk
  • chandan.satija/vtk
  • anuraaga/vtk
  • kxxt/vtk
  • ryosga/vtk
  • Ajile3D/vtk-ajile
  • matekelemen/vtk
  • lililiangyu/vtk
  • ArashPartow/vtk
  • Peter.Zajac/vtk
  • zackgalbreath/vtk
  • bansan/vtk
  • leon.victor/vtk
  • gabbyva5/vtk
  • ClaudioHoffmann/vtk
  • larshg/vtk
  • barracuda156/vtk
  • niconiconi/vtk
  • quangvd3/vtk
  • lmaoha/vtk
  • jarredgaudineer/vtk
  • YingjuHan/vtk
  • afa/vtk
  • thecasterian/vtk
  • codeling/vtk
  • wortiz/vtk
  • undeadde/vtk
  • jonathanschilling/vtk
  • ychu-hoo/vtk
  • FlashPanda/vtk
  • rachedwaly/vtk
  • DownerCase/vtk
  • TurBoss/vtk
  • dunyazad/vtk
  • marquis.weng/vtk
  • chir-set/vtk
  • Mechazo11/az-vtk
  • nekto1989/vtk
  • jean.fechter/vtk
  • anonymous-fys/vtk
  • clintonstimpson/vtk
  • krande/vtk
  • zist8888/vtk
  • Joker-7-7/vtk
  • skashtanov/vtk
  • o.derewonko/vtk
  • ndelpuppo/vtk
  • kenavolic/vtk
  • raimund-schluessler/vtk
  • medmssaouri/vtk-pca-normals
  • karchit0509/vtk
  • gapry/vtk
  • guillaume-jacquenot/vtk
  • Dave-Allured/vtk
  • ctaylo41/vtk
  • johnnynunez/vtk
  • 1div0/vtk
  • aruggieri/vtk
  • LunaNebula/vtk
  • quinn.powell/vtk
  • exbluesbreaker/vtk
  • junghans/vtk
  • NikitaKolebaev/vtk
  • jwilson1881/vtk
  • celynchgt/vtk
  • guillaume.gisbert/vtk
853 results
Show changes
Commits on Source (5)
Showing
with 4613 additions and 4526 deletions
......@@ -8,7 +8,7 @@
#include <vector>
// clang-format off
#include VTK_FMT(fmt/core.h)
#include VTK_FMT(fmt/base.h)
#include VTK_FMT(fmt/ranges.h)
// clang-format on
......
## Update fmt to be based on 11.1.4
Update fmt third party library to be based
on [fmt 8.0.2](https://github.com/fmtlib/fmt/releases/tag/11.1.4).
......@@ -19,10 +19,10 @@
#include <cmath>
#include <string>
#include <vector>
#include <vtk_fmt.h>
#include <vtk_fmt.h>
// clang-format off
#include VTK_FMT(fmt/core.h)
#include VTK_FMT(fmt/format.h)
// clang-format on
VTK_ABI_NAMESPACE_BEGIN
......
......@@ -8,7 +8,7 @@
#include <vtk_fmt.h>
// clang-format off
#include VTK_FMT(fmt/core.h)
#include VTK_FMT(fmt/format.h)
// clang-format on
namespace ensight_gold
......
......@@ -44,7 +44,7 @@
// clang-format off
#include <vtk_fmt.h> // needed for `fmt`
#include VTK_FMT(fmt/core.h)
#include VTK_FMT(fmt/format.h)
// clang-format on
VTK_ABI_NAMESPACE_BEGIN
......
......@@ -42,7 +42,6 @@
// Keep clang-format from adding spaces around the '/' path separator:
// clang-format off
#include VTK_FMT(fmt/args.h)
#include VTK_FMT(fmt/core.h)
#include VTK_FMT(fmt/format.h)
#include VTK_FMT(fmt/ostream.h)
// clang-format on
......
vtk_module_third_party(
INTERNAL
LICENSE_FILES "vtkfmt/LICENSE.rst"
LICENSE_FILES "vtkfmt/LICENSE"
SPDX_LICENSE_IDENTIFIER "MIT"
SPDX_COPYRIGHT_TEXT "Copyright (c) 2012 - present, Victor Zverovich"
SPDX_DOWNLOAD_LOCATION "git+https://gitlab.kitware.com/third-party/fmt.git@for/vtk-20231123-10.1.1"
VERSION "10.1.1"
SPDX_DOWNLOAD_LOCATION "git+https://gitlab.kitware.com/third-party/fmt.git@ebb711aa7c8a339b5508b5f0419837542b2b5833"
VERSION "11.1.4"
STANDARD_INCLUDE_DIRS
EXTERNAL
PACKAGE fmt
TARGETS fmt::fmt
VERSION "9.0.0"
VERSION "11.0.0"
STANDARD_INCLUDE_DIRS)
configure_file(
......
......@@ -7,17 +7,17 @@ shopt -s dotglob
readonly name="fmt"
readonly ownership="{fmt} Upstream <kwrobot@kitware.com>"
readonly subtree="ThirdParty/$name/vtk$name"
readonly repo="https://gitlab.kitware.com/third-party/fmt.git"
readonly tag="for/vtk-20231123-10.1.1"
readonly repo="https://gitlab.kitware.com/spiros.tsalikis/fmt.git"
readonly tag="ebb711aa7c8a339b5508b5f0419837542b2b5833"
readonly paths="
.gitattributes
include/fmt/*.h
src/format.cc
src/os.cc
CMakeLists.vtk.txt
LICENSE.rst
LICENSE
README.kitware.md
README.rst
README.md
"
extract_source () {
......
......@@ -4,6 +4,7 @@ set (sources
set (headers
vtkfmt/args.h
vtkfmt/base.h
vtkfmt/chrono.h
vtkfmt/color.h
vtkfmt/compile.h
......
<img src="https://user-images.githubusercontent.com/576385/156254208-f5b743a9-88cf-439d-b0c0-923d53e8d551.png" alt="{fmt}" width="25%"/>
[![image](https://github.com/fmtlib/fmt/workflows/linux/badge.svg)](https://github.com/fmtlib/fmt/actions?query=workflow%3Alinux)
[![image](https://github.com/fmtlib/fmt/workflows/macos/badge.svg)](https://github.com/fmtlib/fmt/actions?query=workflow%3Amacos)
[![image](https://github.com/fmtlib/fmt/workflows/windows/badge.svg)](https://github.com/fmtlib/fmt/actions?query=workflow%3Awindows)
[![fmt is continuously fuzzed at oss-fuzz](https://oss-fuzz-build-logs.storage.googleapis.com/badges/fmt.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?\%0Acolspec=ID%20Type%20Component%20Status%20Proj%20Reported%20Owner%20\%0ASummary&q=proj%3Dfmt&can=1)
[![Ask questions at StackOverflow with the tag fmt](https://img.shields.io/badge/stackoverflow-fmt-blue.svg)](https://stackoverflow.com/questions/tagged/fmt)
[![image](https://api.securityscorecards.dev/projects/github.com/fmtlib/fmt/badge)](https://securityscorecards.dev/viewer/?uri=github.com/fmtlib/fmt)
**{fmt}** is an open-source formatting library providing a fast and safe
alternative to C stdio and C++ iostreams.
If you like this project, please consider donating to one of the funds
that help victims of the war in Ukraine: <https://www.stopputin.net/>.
[Documentation](https://fmt.dev)
[Cheat Sheets](https://hackingcpp.com/cpp/libs/fmt.html)
Q&A: ask questions on [StackOverflow with the tag
fmt](https://stackoverflow.com/questions/tagged/fmt).
Try {fmt} in [Compiler Explorer](https://godbolt.org/z/8Mx1EW73v).
# Features
- Simple [format API](https://fmt.dev/latest/api/) with positional
arguments for localization
- Implementation of [C++20
std::format](https://en.cppreference.com/w/cpp/utility/format) and
[C++23 std::print](https://en.cppreference.com/w/cpp/io/print)
- [Format string syntax](https://fmt.dev/latest/syntax/) similar
to Python\'s
[format](https://docs.python.org/3/library/stdtypes.html#str.format)
- Fast IEEE 754 floating-point formatter with correct rounding,
shortness and round-trip guarantees using the
[Dragonbox](https://github.com/jk-jeon/dragonbox) algorithm
- Portable Unicode support
- Safe [printf
implementation](https://fmt.dev/latest/api/#printf-formatting)
including the POSIX extension for positional arguments
- Extensibility: [support for user-defined
types](https://fmt.dev/latest/api/#formatting-user-defined-types)
- High performance: faster than common standard library
implementations of `(s)printf`, iostreams, `to_string` and
`to_chars`, see [Speed tests](#speed-tests) and [Converting a
hundred million integers to strings per
second](http://www.zverovich.net/2020/06/13/fast-int-to-string-revisited.html)
- Small code size both in terms of source code with the minimum
configuration consisting of just three files, `core.h`, `format.h`
and `format-inl.h`, and compiled code; see [Compile time and code
bloat](#compile-time-and-code-bloat)
- Reliability: the library has an extensive set of
[tests](https://github.com/fmtlib/fmt/tree/master/test) and is
[continuously fuzzed](https://bugs.chromium.org/p/oss-fuzz/issues/list?colspec=ID%20Type%20Component%20Status%20Proj%20Reported%20Owner%20Summary&q=proj%3Dfmt&can=1)
- Safety: the library is fully type-safe, errors in format strings can
be reported at compile time, automatic memory management prevents
buffer overflow errors
- Ease of use: small self-contained code base, no external
dependencies, permissive MIT
[license](https://github.com/fmtlib/fmt/blob/master/LICENSE)
- [Portability](https://fmt.dev/latest/#portability) with
consistent output across platforms and support for older compilers
- Clean warning-free codebase even on high warning levels such as
`-Wall -Wextra -pedantic`
- Locale independence by default
- Optional header-only configuration enabled with the
`FMT_HEADER_ONLY` macro
See the [documentation](https://fmt.dev) for more details.
# Examples
**Print to stdout** ([run](https://godbolt.org/z/Tevcjh))
``` c++
#include <fmt/core.h>
int main() {
fmt::print("Hello, world!\n");
}
```
**Format a string** ([run](https://godbolt.org/z/oK8h33))
``` c++
std::string s = fmt::format("The answer is {}.", 42);
// s == "The answer is 42."
```
**Format a string using positional arguments**
([run](https://godbolt.org/z/Yn7Txe))
``` c++
std::string s = fmt::format("I'd rather be {1} than {0}.", "right", "happy");
// s == "I'd rather be happy than right."
```
**Print dates and times** ([run](https://godbolt.org/z/c31ExdY3W))
``` c++
#include <fmt/chrono.h>
int main() {
auto now = std::chrono::system_clock::now();
fmt::print("Date and time: {}\n", now);
fmt::print("Time: {:%H:%M}\n", now);
}
```
Output:
Date and time: 2023-12-26 19:10:31.557195597
Time: 19:10
**Print a container** ([run](https://godbolt.org/z/MxM1YqjE7))
``` c++
#include <vector>
#include <fmt/ranges.h>
int main() {
std::vector<int> v = {1, 2, 3};
fmt::print("{}\n", v);
}
```
Output:
[1, 2, 3]
**Check a format string at compile time**
``` c++
std::string s = fmt::format("{:d}", "I am not a number");
```
This gives a compile-time error in C++20 because `d` is an invalid
format specifier for a string.
**Write a file from a single thread**
``` c++
#include <fmt/os.h>
int main() {
auto out = fmt::output_file("guide.txt");
out.print("Don't {}", "Panic");
}
```
This can be [5 to 9 times faster than
fprintf](http://www.zverovich.net/2020/08/04/optimal-file-buffer-size.html).
**Print with colors and text styles**
``` c++
#include <fmt/color.h>
int main() {
fmt::print(fg(fmt::color::crimson) | fmt::emphasis::bold,
"Hello, {}!\n", "world");
fmt::print(fg(fmt::color::floral_white) | bg(fmt::color::slate_gray) |
fmt::emphasis::underline, "Olá, {}!\n", "Mundo");
fmt::print(fg(fmt::color::steel_blue) | fmt::emphasis::italic,
"你好{}!\n", "世界");
}
```
Output on a modern terminal with Unicode support:
![image](https://github.com/fmtlib/fmt/assets/%0A576385/2a93c904-d6fa-4aa6-b453-2618e1c327d7)
# Benchmarks
## Speed tests
| Library | Method | Run Time, s |
|-------------------|---------------|-------------|
| libc | printf | 0.91 |
| libc++ | std::ostream | 2.49 |
| {fmt} 9.1 | fmt::print | 0.74 |
| Boost Format 1.80 | boost::format | 6.26 |
| Folly Format | folly::format | 1.87 |
{fmt} is the fastest of the benchmarked methods, \~20% faster than
`printf`.
The above results were generated by building `tinyformat_test.cpp` on
macOS 12.6.1 with `clang++ -O3 -DNDEBUG -DSPEED_TEST -DHAVE_FORMAT`, and
taking the best of three runs. In the test, the format string
`"%0.10f:%04d:%+g:%s:%p:%c:%%\n"` or equivalent is filled 2,000,000
times with output sent to `/dev/null`; for further details refer to the
[source](https://github.com/fmtlib/format-benchmark/blob/master/src/tinyformat-test.cc).
{fmt} is up to 20-30x faster than `std::ostringstream` and `sprintf` on
IEEE754 `float` and `double` formatting
([dtoa-benchmark](https://github.com/fmtlib/dtoa-benchmark)) and faster
than [double-conversion](https://github.com/google/double-conversion)
and [ryu](https://github.com/ulfjack/ryu):
[![image](https://user-images.githubusercontent.com/576385/95684665-11719600-0ba8-11eb-8e5b-972ff4e49428.png)](https://fmt.dev/unknown_mac64_clang12.0.html)
## Compile time and code bloat
The script [bloat-test.py][test] from [format-benchmark][bench] tests compile
time and code bloat for nontrivial projects. It generates 100 translation units
and uses `printf()` or its alternative five times in each to simulate a
medium-sized project. The resulting executable size and compile time (Apple
clang version 15.0.0 (clang-1500.1.0.2.5), macOS Sonoma, best of three) is shown
in the following tables.
[test]: https://github.com/fmtlib/format-benchmark/blob/master/bloat-test.py
[bench]: https://github.com/fmtlib/format-benchmark
**Optimized build (-O3)**
| Method | Compile Time, s | Executable size, KiB | Stripped size, KiB |
|---------------|-----------------|----------------------|--------------------|
| printf | 1.6 | 54 | 50 |
| IOStreams | 25.9 | 98 | 84 |
| fmt 83652df | 4.8 | 54 | 50 |
| tinyformat | 29.1 | 161 | 136 |
| Boost Format | 55.0 | 530 | 317 |
{fmt} is fast to compile and is comparable to `printf` in terms of per-call
binary size (within a rounding error on this system).
**Non-optimized build**
| Method | Compile Time, s | Executable size, KiB | Stripped size, KiB |
|---------------|-----------------|----------------------|--------------------|
| printf | 1.4 | 54 | 50 |
| IOStreams | 23.4 | 92 | 68 |
| {fmt} 83652df | 4.4 | 89 | 85 |
| tinyformat | 24.5 | 204 | 161 |
| Boost Format | 36.4 | 831 | 462 |
`libc`, `lib(std)c++`, and `libfmt` are all linked as shared libraries
to compare formatting function overhead only. Boost Format is a
header-only library so it doesn\'t provide any linkage options.
## Running the tests
Please refer to [Building the
library](https://fmt.dev/latest/get-started/#building-from-source) for
instructions on how to build the library and run the unit tests.
Benchmarks reside in a separate repository,
[format-benchmarks](https://github.com/fmtlib/format-benchmark), so to
run the benchmarks you first need to clone this repository and generate
Makefiles with CMake:
$ git clone --recursive https://github.com/fmtlib/format-benchmark.git
$ cd format-benchmark
$ cmake .
Then you can run the speed test:
$ make speed-test
or the bloat test:
$ make bloat-test
# Migrating code
[clang-tidy](https://clang.llvm.org/extra/clang-tidy/) v18 provides the
[modernize-use-std-print](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-std-print.html)
check that is capable of converting occurrences of `printf` and
`fprintf` to `fmt::print` if configured to do so. (By default it
converts to `std::print`.)
# Notable projects using this library
- [0 A.D.](https://play0ad.com/): a free, open-source, cross-platform
real-time strategy game
- [AMPL/MP](https://github.com/ampl/mp): an open-source library for
mathematical programming
- [Apple's FoundationDB](https://github.com/apple/foundationdb): an open-source,
distributed, transactional key-value store
- [Aseprite](https://github.com/aseprite/aseprite): animated sprite
editor & pixel art tool
- [AvioBook](https://www.aviobook.aero/en): a comprehensive aircraft
operations suite
- [Blizzard Battle.net](https://battle.net/): an online gaming
platform
- [Celestia](https://celestia.space/): real-time 3D visualization of
space
- [Ceph](https://ceph.com/): a scalable distributed storage system
- [ccache](https://ccache.dev/): a compiler cache
- [ClickHouse](https://github.com/ClickHouse/ClickHouse): an
analytical database management system
- [ContextVision](https://www.contextvision.com/): medical imaging software
- [Contour](https://github.com/contour-terminal/contour/): a modern
terminal emulator
- [CUAUV](https://cuauv.org/): Cornell University\'s autonomous
underwater vehicle
- [Drake](https://drake.mit.edu/): a planning, control, and analysis
toolbox for nonlinear dynamical systems (MIT)
- [Envoy](https://github.com/envoyproxy/envoy): C++ L7 proxy and
communication bus (Lyft)
- [FiveM](https://fivem.net/): a modification framework for GTA V
- [fmtlog](https://github.com/MengRao/fmtlog): a performant
fmtlib-style logging library with latency in nanoseconds
- [Folly](https://github.com/facebook/folly): Facebook open-source
library
- [GemRB](https://gemrb.org/): a portable open-source implementation
of Bioware's Infinity Engine
- [Grand Mountain
Adventure](https://store.steampowered.com/app/1247360/Grand_Mountain_Adventure/):
a beautiful open-world ski & snowboarding game
- [HarpyWar/pvpgn](https://github.com/pvpgn/pvpgn-server): Player vs
Player Gaming Network with tweaks
- [KBEngine](https://github.com/kbengine/kbengine): an open-source
MMOG server engine
- [Keypirinha](https://keypirinha.com/): a semantic launcher for
Windows
- [Kodi](https://kodi.tv/) (formerly xbmc): home theater software
- [Knuth](https://kth.cash/): high-performance Bitcoin full-node
- [libunicode](https://github.com/contour-terminal/libunicode/): a
modern C++17 Unicode library
- [MariaDB](https://mariadb.org/): relational database management
system
- [Microsoft Verona](https://github.com/microsoft/verona): research
programming language for concurrent ownership
- [MongoDB](https://mongodb.com/): distributed document database
- [MongoDB Smasher](https://github.com/duckie/mongo_smasher): a small
tool to generate randomized datasets
- [OpenSpace](https://openspaceproject.com/): an open-source
astrovisualization framework
- [PenUltima Online (POL)](https://www.polserver.com/): an MMO server,
compatible with most Ultima Online clients
- [PyTorch](https://github.com/pytorch/pytorch): an open-source
machine learning library
- [quasardb](https://www.quasardb.net/): a distributed,
high-performance, associative database
- [Quill](https://github.com/odygrd/quill): asynchronous low-latency
logging library
- [QKW](https://github.com/ravijanjam/qkw): generalizing aliasing to
simplify navigation, and execute complex multi-line terminal
command sequences
- [redis-cerberus](https://github.com/HunanTV/redis-cerberus): a Redis
cluster proxy
- [redpanda](https://vectorized.io/redpanda): a 10x faster Kafka®
replacement for mission-critical systems written in C++
- [rpclib](http://rpclib.net/): a modern C++ msgpack-RPC server and
client library
- [Salesforce Analytics
Cloud](https://www.salesforce.com/analytics-cloud/overview/):
business intelligence software
- [Scylla](https://www.scylladb.com/): a Cassandra-compatible NoSQL
data store that can handle 1 million transactions per second on a
single server
- [Seastar](http://www.seastar-project.org/): an advanced, open-source
C++ framework for high-performance server applications on modern
hardware
- [spdlog](https://github.com/gabime/spdlog): super fast C++ logging
library
- [Stellar](https://www.stellar.org/): financial platform
- [Touch Surgery](https://www.touchsurgery.com/): surgery simulator
- [TrinityCore](https://github.com/TrinityCore/TrinityCore):
open-source MMORPG framework
- [🐙 userver framework](https://userver.tech/): open-source
asynchronous framework with a rich set of abstractions and database
drivers
- [Windows Terminal](https://github.com/microsoft/terminal): the new
Windows terminal
[More\...](https://github.com/search?q=fmtlib&type=Code)
If you are aware of other projects using this library, please let me
know by [email](mailto:victor.zverovich@gmail.com) or by submitting an
[issue](https://github.com/fmtlib/fmt/issues).
# Motivation
So why yet another formatting library?
There are plenty of methods for doing this task, from standard ones like
the printf family of function and iostreams to Boost Format and
FastFormat libraries. The reason for creating a new library is that
every existing solution that I found either had serious issues or
didn\'t provide all the features I needed.
## printf
The good thing about `printf` is that it is pretty fast and readily
available being a part of the C standard library. The main drawback is
that it doesn\'t support user-defined types. `printf` also has safety
issues although they are somewhat mitigated with [\_\_attribute\_\_
((format (printf,
\...))](https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html) in
GCC. There is a POSIX extension that adds positional arguments required
for
[i18n](https://en.wikipedia.org/wiki/Internationalization_and_localization)
to `printf` but it is not a part of C99 and may not be available on some
platforms.
## iostreams
The main issue with iostreams is best illustrated with an example:
``` c++
std::cout << std::setprecision(2) << std::fixed << 1.23456 << "\n";
```
which is a lot of typing compared to printf:
``` c++
printf("%.2f\n", 1.23456);
```
Matthew Wilson, the author of FastFormat, called this \"chevron hell\".
iostreams don\'t support positional arguments by design.
The good part is that iostreams support user-defined types and are safe
although error handling is awkward.
## Boost Format
This is a very powerful library that supports both `printf`-like format
strings and positional arguments. Its main drawback is performance.
According to various benchmarks, it is much slower than other methods
considered here. Boost Format also has excessive build times and severe
code bloat issues (see [Benchmarks](#benchmarks)).
## FastFormat
This is an interesting library that is fast, safe and has positional
arguments. However, it has significant limitations, citing its author:
> Three features that have no hope of being accommodated within the
> current design are:
>
> - Leading zeros (or any other non-space padding)
> - Octal/hexadecimal encoding
> - Runtime width/alignment specification
It is also quite big and has a heavy dependency, on STLSoft, which might be
too restrictive for use in some projects.
## Boost Spirit.Karma
This is not a formatting library but I decided to include it here for
completeness. As iostreams, it suffers from the problem of mixing
verbatim text with arguments. The library is pretty fast, but slower on
integer formatting than `fmt::format_to` with format string compilation
on Karma\'s own benchmark, see [Converting a hundred million integers to
strings per
second](http://www.zverovich.net/2020/06/13/fast-int-to-string-revisited.html).
# License
{fmt} is distributed under the MIT
[license](https://github.com/fmtlib/fmt/blob/master/LICENSE).
# Documentation License
The [Format String Syntax](https://fmt.dev/latest/syntax/) section
in the documentation is based on the one from Python [string module
documentation](https://docs.python.org/3/library/string.html#module-string).
For this reason, the documentation is distributed under the Python
Software Foundation license available in
[doc/python-license.txt](https://raw.github.com/fmtlib/fmt/master/doc/python-license.txt).
It only applies if you distribute the documentation of {fmt}.
# Maintainers
The {fmt} library is maintained by Victor Zverovich
([vitaut](https://github.com/vitaut)) with contributions from many other
people. See
[Contributors](https://github.com/fmtlib/fmt/graphs/contributors) and
[Releases](https://github.com/fmtlib/fmt/releases) for some of the
names. Let us know if your contribution is not listed or mentioned
incorrectly and we\'ll make it right.
# Security Policy
To report a security issue, please disclose it at [security
advisory](https://github.com/fmtlib/fmt/security/advisories/new).
This project is maintained by a team of volunteers on a
reasonable-effort basis. As such, please give us at least *90* days to
work on a fix before public exposure.
This diff is collapsed.
......@@ -16,7 +16,8 @@ template FMT_API auto dragonbox::to_decimal(float x) noexcept
template FMT_API auto dragonbox::to_decimal(double x) noexcept
-> dragonbox::decimal_fp<double>;
#ifndef FMT_STATIC_THOUSANDS_SEPARATOR
#if FMT_USE_LOCALE
// DEPRECATED! locale_ref in the detail namespace
template FMT_API locale_ref::locale_ref(const std::locale& loc);
template FMT_API auto locale_ref::get<std::locale>() const -> std::locale;
#endif
......@@ -27,8 +28,10 @@ template FMT_API auto thousands_sep_impl(locale_ref)
-> thousands_sep_result<char>;
template FMT_API auto decimal_point_impl(locale_ref) -> char;
// DEPRECATED!
template FMT_API void buffer<char>::append(const char*, const char*);
// DEPRECATED!
template FMT_API void vformat_to(buffer<char>&, string_view,
typename vformat_args<>::type, locale_ref);
......
......@@ -13,47 +13,51 @@
// xxx(kitware) fix path
#include "vtkfmt/os.h"
#include <climits>
#ifndef FMT_MODULE
# include <climits>
#if FMT_USE_FCNTL
# include <sys/stat.h>
# include <sys/types.h>
# ifdef _WRS_KERNEL // VxWorks7 kernel
# include <ioLib.h> // getpagesize
# endif
# if FMT_USE_FCNTL
# include <sys/stat.h>
# include <sys/types.h>
# ifndef _WIN32
# include <unistd.h>
# else
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# ifdef _WRS_KERNEL // VxWorks7 kernel
# include <ioLib.h> // getpagesize
# endif
# include <io.h>
# ifndef S_IRUSR
# define S_IRUSR _S_IREAD
# endif
# ifndef S_IWUSR
# define S_IWUSR _S_IWRITE
# endif
# ifndef S_IRGRP
# define S_IRGRP 0
# endif
# ifndef S_IWGRP
# define S_IWGRP 0
# endif
# ifndef S_IROTH
# define S_IROTH 0
# endif
# ifndef S_IWOTH
# define S_IWOTH 0
# endif
# endif // _WIN32
#endif // FMT_USE_FCNTL
# ifndef _WIN32
# include <unistd.h>
# else
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <io.h>
# endif // _WIN32
# endif // FMT_USE_FCNTL
# ifdef _WIN32
# include <windows.h>
# endif
#endif
#ifdef _WIN32
# include <windows.h>
# ifndef S_IRUSR
# define S_IRUSR _S_IREAD
# endif
# ifndef S_IWUSR
# define S_IWUSR _S_IWRITE
# endif
# ifndef S_IRGRP
# define S_IRGRP 0
# endif
# ifndef S_IWGRP
# define S_IWGRP 0
# endif
# ifndef S_IROTH
# define S_IROTH 0
# endif
# ifndef S_IWOTH
# define S_IWOTH 0
# endif
#endif
namespace {
......@@ -157,7 +161,7 @@ void detail::format_windows_error(detail::buffer<char>& out, int error_code,
}
void report_windows_error(int error_code, const char* message) noexcept {
report_error(detail::format_windows_error, error_code, message);
do_report_error(detail::format_windows_error, error_code, message);
}
#endif // _WIN32
......@@ -183,10 +187,16 @@ void buffered_file::close() {
}
int buffered_file::descriptor() const {
#ifdef fileno // fileno is a macro on OpenBSD so we cannot use FMT_POSIX_CALL.
int fd = fileno(file_);
#else
#ifdef FMT_HAS_SYSTEM
// fileno is a macro on OpenBSD.
# ifdef fileno
# undef fileno
# endif
int fd = FMT_POSIX_CALL(fileno(file_));
#elif defined(_WIN32)
int fd = _fileno(file_);
#else
int fd = fileno(file_);
#endif
if (fd == -1)
FMT_THROW(system_error(errno, FMT_STRING("cannot get file descriptor")));
......@@ -197,6 +207,7 @@ int buffered_file::descriptor() const {
# ifdef _WIN32
using mode_t = int;
# endif
constexpr mode_t default_open_mode =
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
......@@ -298,29 +309,6 @@ void file::dup2(int fd, std::error_code& ec) noexcept {
if (result == -1) ec = std::error_code(errno, std::generic_category());
}
void file::pipe(file& read_end, file& write_end) {
// Close the descriptors first to make sure that assignments don't throw
// and there are no leaks.
read_end.close();
write_end.close();
int fds[2] = {};
# ifdef _WIN32
// Make the default pipe capacity same as on Linux 2.6.11+.
enum { DEFAULT_CAPACITY = 65536 };
int result = FMT_POSIX_CALL(pipe(fds, DEFAULT_CAPACITY, _O_BINARY));
# else
// Don't retry as the pipe function doesn't return EINTR.
// http://pubs.opengroup.org/onlinepubs/009696799/functions/pipe.html
int result = FMT_POSIX_CALL(pipe(fds));
# endif
if (result != 0)
FMT_THROW(system_error(errno, FMT_STRING("cannot create pipe")));
// The following assignments don't throw because read_fd and write_fd
// are closed.
read_end = file(fds[0]);
write_end = file(fds[1]);
}
buffered_file file::fdopen(const char* mode) {
// Don't retry as fdopen doesn't return EINTR.
# if defined(__MINGW32__) && defined(_POSIX_)
......@@ -349,6 +337,24 @@ file file::open_windows_file(wcstring_view path, int oflag) {
}
# endif
pipe::pipe() {
int fds[2] = {};
# ifdef _WIN32
// Make the default pipe capacity same as on Linux 2.6.11+.
enum { DEFAULT_CAPACITY = 65536 };
int result = FMT_POSIX_CALL(pipe(fds, DEFAULT_CAPACITY, _O_BINARY));
# else
// Don't retry as the pipe function doesn't return EINTR.
// http://pubs.opengroup.org/onlinepubs/009696799/functions/pipe.html
int result = FMT_POSIX_CALL(pipe(fds));
# endif
if (result != 0)
FMT_THROW(system_error(errno, FMT_STRING("cannot create pipe")));
// The following assignments don't throw.
read_end = file(fds[0]);
write_end = file(fds[1]);
}
# if !defined(__MSDOS__)
long getpagesize() {
# ifdef _WIN32
......@@ -369,31 +375,25 @@ long getpagesize() {
}
# endif
namespace detail {
void file_buffer::grow(size_t) {
if (this->size() == this->capacity()) flush();
void ostream::grow(buffer<char>& buf, size_t) {
if (buf.size() == buf.capacity()) static_cast<ostream&>(buf).flush();
}
file_buffer::file_buffer(cstring_view path,
const detail::ostream_params& params)
: file_(path, params.oflag) {
ostream::ostream(cstring_view path, const detail::ostream_params& params)
: buffer<char>(grow), file_(path, params.oflag) {
set(new char[params.buffer_size], params.buffer_size);
}
file_buffer::file_buffer(file_buffer&& other)
: detail::buffer<char>(other.data(), other.size(), other.capacity()),
ostream::ostream(ostream&& other) noexcept
: buffer<char>(grow, other.data(), other.size(), other.capacity()),
file_(std::move(other.file_)) {
other.clear();
other.set(nullptr, 0);
}
file_buffer::~file_buffer() {
ostream::~ostream() {
flush();
delete[] data();
}
} // namespace detail
ostream::~ostream() = default;
#endif // FMT_USE_FCNTL
FMT_END_NAMESPACE
......@@ -8,34 +8,39 @@
#ifndef FMT_ARGS_H_
#define FMT_ARGS_H_
#include <functional> // std::reference_wrapper
#include <memory> // std::unique_ptr
#include <vector>
#ifndef FMT_MODULE
# include <functional> // std::reference_wrapper
# include <memory> // std::unique_ptr
# include <vector>
#endif
#include "core.h"
#include "format.h" // std_string_view
FMT_BEGIN_NAMESPACE
namespace detail {
template <typename T> struct is_reference_wrapper : std::false_type {};
template <typename T>
struct is_reference_wrapper<std::reference_wrapper<T>> : std::true_type {};
template <typename T> const T& unwrap(const T& v) { return v; }
template <typename T> const T& unwrap(const std::reference_wrapper<T>& v) {
template <typename T> auto unwrap(const T& v) -> const T& { return v; }
template <typename T>
auto unwrap(const std::reference_wrapper<T>& v) -> const T& {
return static_cast<const T&>(v);
}
class dynamic_arg_list {
// Workaround for clang's -Wweak-vtables. Unlike for regular classes, for
// templates it doesn't complain about inability to deduce single translation
// unit for placing vtable. So storage_node_base is made a fake template.
template <typename = void> struct node {
virtual ~node() = default;
std::unique_ptr<node<>> next;
};
// node is defined outside dynamic_arg_list to workaround a C2504 bug in MSVC
// 2022 (v17.10.0).
//
// Workaround for clang's -Wweak-vtables. Unlike for regular classes, for
// templates it doesn't complain about inability to deduce single translation
// unit for placing vtable. So node is made a fake template.
template <typename = void> struct node {
virtual ~node() = default;
std::unique_ptr<node<>> next;
};
class dynamic_arg_list {
template <typename T> struct typed_node : node<> {
T value;
......@@ -50,7 +55,7 @@ class dynamic_arg_list {
std::unique_ptr<node<>> head_;
public:
template <typename T, typename Arg> const T& push(const Arg& arg) {
template <typename T, typename Arg> auto push(const Arg& arg) -> const T& {
auto new_node = std::unique_ptr<typed_node<T>>(new typed_node<T>(arg));
auto& value = new_node->value;
new_node->next = std::move(head_);
......@@ -61,28 +66,18 @@ class dynamic_arg_list {
} // namespace detail
/**
\rst
A dynamic version of `fmt::format_arg_store`.
It's equipped with a storage to potentially temporary objects which lifetimes
could be shorter than the format arguments object.
It can be implicitly converted into `~fmt::basic_format_args` for passing
into type-erased formatting functions such as `~fmt::vformat`.
\endrst
* A dynamic list of formatting arguments with storage.
*
* It can be implicitly converted into `fmt::basic_format_args` for passing
* into type-erased formatting functions such as `fmt::vformat`.
*/
template <typename Context>
class dynamic_format_arg_store
#if FMT_GCC_VERSION && FMT_GCC_VERSION < 409
// Workaround a GCC template argument substitution bug.
: public basic_format_args<Context>
#endif
{
template <typename Context> class dynamic_format_arg_store {
private:
using char_type = typename Context::char_type;
template <typename T> struct need_copy {
static constexpr detail::type mapped_type =
detail::mapped_type_constant<T, Context>::value;
detail::mapped_type_constant<T, char_type>::value;
enum {
value = !(detail::is_reference_wrapper<T>::value ||
......@@ -95,7 +90,7 @@ class dynamic_format_arg_store
};
template <typename T>
using stored_type = conditional_t<
using stored_t = conditional_t<
std::is_convertible<T, std::basic_string<char_type>>::value &&
!detail::is_reference_wrapper<T>::value,
std::basic_string<char_type>, T>;
......@@ -110,80 +105,72 @@ class dynamic_format_arg_store
friend class basic_format_args<Context>;
unsigned long long get_types() const {
return detail::is_unpacked_bit | data_.size() |
(named_info_.empty()
? 0ULL
: static_cast<unsigned long long>(detail::has_named_args_bit));
}
const basic_format_arg<Context>* data() const {
auto data() const -> const basic_format_arg<Context>* {
return named_info_.empty() ? data_.data() : data_.data() + 1;
}
template <typename T> void emplace_arg(const T& arg) {
data_.emplace_back(detail::make_arg<Context>(arg));
data_.emplace_back(arg);
}
template <typename T>
void emplace_arg(const detail::named_arg<char_type, T>& arg) {
if (named_info_.empty()) {
constexpr const detail::named_arg_info<char_type>* zero_ptr{nullptr};
data_.insert(data_.begin(), {zero_ptr, 0});
}
data_.emplace_back(detail::make_arg<Context>(detail::unwrap(arg.value)));
if (named_info_.empty())
data_.insert(data_.begin(), basic_format_arg<Context>(nullptr, 0));
data_.emplace_back(detail::unwrap(arg.value));
auto pop_one = [](std::vector<basic_format_arg<Context>>* data) {
data->pop_back();
};
std::unique_ptr<std::vector<basic_format_arg<Context>>, decltype(pop_one)>
guard{&data_, pop_one};
named_info_.push_back({arg.name, static_cast<int>(data_.size() - 2u)});
data_[0].value_.named_args = {named_info_.data(), named_info_.size()};
data_[0] = {named_info_.data(), named_info_.size()};
guard.release();
}
public:
constexpr dynamic_format_arg_store() = default;
operator basic_format_args<Context>() const {
return basic_format_args<Context>(data(), static_cast<int>(data_.size()),
!named_info_.empty());
}
/**
\rst
Adds an argument into the dynamic store for later passing to a formatting
function.
Note that custom types and string types (but not string views) are copied
into the store dynamically allocating memory if necessary.
**Example**::
fmt::dynamic_format_arg_store<fmt::format_context> store;
store.push_back(42);
store.push_back("abc");
store.push_back(1.5f);
std::string result = fmt::vformat("{} and {} and {}", store);
\endrst
*/
* Adds an argument into the dynamic store for later passing to a formatting
* function.
*
* Note that custom types and string types (but not string views) are copied
* into the store dynamically allocating memory if necessary.
*
* **Example**:
*
* fmt::dynamic_format_arg_store<fmt::format_context> store;
* store.push_back(42);
* store.push_back("abc");
* store.push_back(1.5f);
* std::string result = fmt::vformat("{} and {} and {}", store);
*/
template <typename T> void push_back(const T& arg) {
if (detail::const_check(need_copy<T>::value))
emplace_arg(dynamic_args_.push<stored_type<T>>(arg));
emplace_arg(dynamic_args_.push<stored_t<T>>(arg));
else
emplace_arg(detail::unwrap(arg));
}
/**
\rst
Adds a reference to the argument into the dynamic store for later passing to
a formatting function.
**Example**::
fmt::dynamic_format_arg_store<fmt::format_context> store;
char band[] = "Rolling Stones";
store.push_back(std::cref(band));
band[9] = 'c'; // Changing str affects the output.
std::string result = fmt::vformat("{}", store);
// result == "Rolling Scones"
\endrst
*/
* Adds a reference to the argument into the dynamic store for later passing
* to a formatting function.
*
* **Example**:
*
* fmt::dynamic_format_arg_store<fmt::format_context> store;
* char band[] = "Rolling Stones";
* store.push_back(std::cref(band));
* band[9] = 'c'; // Changing str affects the output.
* std::string result = fmt::vformat("{}", store);
* // result == "Rolling Scones"
*/
template <typename T> void push_back(std::reference_wrapper<T> arg) {
static_assert(
need_copy<T>::value,
......@@ -192,41 +179,40 @@ class dynamic_format_arg_store
}
/**
Adds named argument into the dynamic store for later passing to a formatting
function. ``std::reference_wrapper`` is supported to avoid copying of the
argument. The name is always copied into the store.
*/
* Adds named argument into the dynamic store for later passing to a
* formatting function. `std::reference_wrapper` is supported to avoid
* copying of the argument. The name is always copied into the store.
*/
template <typename T>
void push_back(const detail::named_arg<char_type, T>& arg) {
const char_type* arg_name =
dynamic_args_.push<std::basic_string<char_type>>(arg.name).c_str();
if (detail::const_check(need_copy<T>::value)) {
emplace_arg(
fmt::arg(arg_name, dynamic_args_.push<stored_type<T>>(arg.value)));
fmt::arg(arg_name, dynamic_args_.push<stored_t<T>>(arg.value)));
} else {
emplace_arg(fmt::arg(arg_name, arg.value));
}
}
/** Erase all elements from the store */
/// Erase all elements from the store.
void clear() {
data_.clear();
named_info_.clear();
dynamic_args_ = detail::dynamic_arg_list();
dynamic_args_ = {};
}
/**
\rst
Reserves space to store at least *new_cap* arguments including
*new_cap_named* named arguments.
\endrst
*/
/// Reserves space to store at least `new_cap` arguments including
/// `new_cap_named` named arguments.
void reserve(size_t new_cap, size_t new_cap_named) {
FMT_ASSERT(new_cap >= new_cap_named,
"Set of arguments includes set of named arguments");
"set of arguments includes set of named arguments");
data_.reserve(new_cap);
named_info_.reserve(new_cap_named);
}
/// Returns the number of elements in the store.
size_t size() const noexcept { return data_.size(); }
};
FMT_END_NAMESPACE
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -8,56 +8,41 @@
#ifndef FMT_COMPILE_H_
#define FMT_COMPILE_H_
#ifndef FMT_MODULE
# include <iterator> // std::back_inserter
#endif
#include "format.h"
FMT_BEGIN_NAMESPACE
namespace detail {
template <typename Char, typename InputIt>
FMT_CONSTEXPR inline counting_iterator copy_str(InputIt begin, InputIt end,
counting_iterator it) {
return it + (end - begin);
}
// A compile-time string which is compiled into fast formatting code.
class compiled_string {};
FMT_EXPORT class compiled_string {};
template <typename S>
struct is_compiled_string : std::is_base_of<compiled_string, S> {};
/**
\rst
Converts a string literal *s* into a format string that will be parsed at
compile time and converted into efficient formatting code. Requires C++17
``constexpr if`` compiler support.
**Example**::
namespace detail {
// Converts 42 into std::string using the most efficient method and no
// runtime format string processing.
std::string s = fmt::format(FMT_COMPILE("{}"), 42);
\endrst
/**
* Converts a string literal `s` into a format string that will be parsed at
* compile time and converted into efficient formatting code. Requires C++17
* `constexpr if` compiler support.
*
* **Example**:
*
* // Converts 42 into std::string using the most efficient method and no
* // runtime format string processing.
* std::string s = fmt::format(FMT_COMPILE("{}"), 42);
*/
#if defined(__cpp_if_constexpr) && defined(__cpp_return_type_deduction)
# define FMT_COMPILE(s) \
FMT_STRING_IMPL(s, fmt::detail::compiled_string, explicit)
# define FMT_COMPILE(s) FMT_STRING_IMPL(s, fmt::compiled_string)
#else
# define FMT_COMPILE(s) FMT_STRING(s)
#endif
#if FMT_USE_NONTYPE_TEMPLATE_ARGS
template <typename Char, size_t N,
fmt::detail_exported::fixed_string<Char, N> Str>
struct udl_compiled_string : compiled_string {
using char_type = Char;
explicit constexpr operator basic_string_view<char_type>() const {
return {Str.data, N - 1};
}
};
#endif
template <typename T, typename... Tail>
const T& first(const T& value, const Tail&...) {
auto first(const T& value, const Tail&...) -> const T& {
return value;
}
......@@ -75,6 +60,29 @@ constexpr const auto& get([[maybe_unused]] const T& first,
return detail::get<N - 1>(rest...);
}
# if FMT_USE_NONTYPE_TEMPLATE_ARGS
template <int N, typename T, typename... Args, typename Char>
constexpr auto get_arg_index_by_name(basic_string_view<Char> name) -> int {
if constexpr (is_static_named_arg<T>()) {
if (name == T::name) return N;
}
if constexpr (sizeof...(Args) > 0)
return get_arg_index_by_name<N + 1, Args...>(name);
(void)name; // Workaround an MSVC bug about "unused" parameter.
return -1;
}
# endif
template <typename... Args, typename Char>
FMT_CONSTEXPR auto get_arg_index_by_name(basic_string_view<Char> name) -> int {
# if FMT_USE_NONTYPE_TEMPLATE_ARGS
if constexpr (sizeof...(Args) > 0)
return get_arg_index_by_name<0, Args...>(name);
# endif
(void)name;
return -1;
}
template <typename Char, typename... Args>
constexpr int get_arg_index_by_name(basic_string_view<Char> name,
type_list<Args...>) {
......@@ -144,11 +152,12 @@ template <typename Char, typename T, int N> struct field {
template <typename OutputIt, typename... Args>
constexpr OutputIt format(OutputIt out, const Args&... args) const {
const T& arg = get_arg_checked<T, N>(args...);
if constexpr (std::is_convertible_v<T, basic_string_view<Char>>) {
if constexpr (std::is_convertible<T, basic_string_view<Char>>::value) {
auto s = basic_string_view<Char>(arg);
return copy_str<Char>(s.begin(), s.end(), out);
return copy<Char>(s.begin(), s.end(), out);
} else {
return write<Char>(out, arg);
}
return write<Char>(out, arg);
}
};
......@@ -236,13 +245,12 @@ constexpr size_t parse_text(basic_string_view<Char> str, size_t pos) {
}
template <typename Args, size_t POS, int ID, typename S>
constexpr auto compile_format_string(S format_str);
constexpr auto compile_format_string(S fmt);
template <typename Args, size_t POS, int ID, typename T, typename S>
constexpr auto parse_tail(T head, S format_str) {
if constexpr (POS !=
basic_string_view<typename S::char_type>(format_str).size()) {
constexpr auto tail = compile_format_string<Args, POS, ID>(format_str);
constexpr auto parse_tail(T head, S fmt) {
if constexpr (POS != basic_string_view<typename S::char_type>(fmt).size()) {
constexpr auto tail = compile_format_string<Args, POS, ID>(fmt);
if constexpr (std::is_same<remove_cvref_t<decltype(tail)>,
unknown_format>())
return tail;
......@@ -274,6 +282,7 @@ constexpr parse_specs_result<T, Char> parse_specs(basic_string_view<Char> str,
}
template <typename Char> struct arg_id_handler {
arg_id_kind kind;
arg_ref<Char> arg_id;
constexpr int on_auto() {
......@@ -281,25 +290,28 @@ template <typename Char> struct arg_id_handler {
return 0;
}
constexpr int on_index(int id) {
kind = arg_id_kind::index;
arg_id = arg_ref<Char>(id);
return 0;
}
constexpr int on_name(basic_string_view<Char> id) {
kind = arg_id_kind::name;
arg_id = arg_ref<Char>(id);
return 0;
}
};
template <typename Char> struct parse_arg_id_result {
arg_id_kind kind;
arg_ref<Char> arg_id;
const Char* arg_id_end;
};
template <int ID, typename Char>
constexpr auto parse_arg_id(const Char* begin, const Char* end) {
auto handler = arg_id_handler<Char>{arg_ref<Char>{}};
auto handler = arg_id_handler<Char>{arg_id_kind::none, arg_ref<Char>{}};
auto arg_id_end = parse_arg_id(begin, end, handler);
return parse_arg_id_result<Char>{handler.arg_id, arg_id_end};
return parse_arg_id_result<Char>{handler.kind, handler.arg_id, arg_id_end};
}
template <typename T, typename Enable = void> struct field_type {
......@@ -313,14 +325,13 @@ struct field_type<T, enable_if_t<detail::is_named_arg<T>::value>> {
template <typename T, typename Args, size_t END_POS, int ARG_INDEX, int NEXT_ID,
typename S>
constexpr auto parse_replacement_field_then_tail(S format_str) {
constexpr auto parse_replacement_field_then_tail(S fmt) {
using char_type = typename S::char_type;
constexpr auto str = basic_string_view<char_type>(format_str);
constexpr auto str = basic_string_view<char_type>(fmt);
constexpr char_type c = END_POS != str.size() ? str[END_POS] : char_type();
if constexpr (c == '}') {
return parse_tail<Args, END_POS + 1, NEXT_ID>(
field<char_type, typename field_type<T>::type, ARG_INDEX>(),
format_str);
field<char_type, typename field_type<T>::type, ARG_INDEX>(), fmt);
} else if constexpr (c != ':') {
FMT_THROW(format_error("expected ':'"));
} else {
......@@ -333,7 +344,7 @@ constexpr auto parse_replacement_field_then_tail(S format_str) {
return parse_tail<Args, result.end + 1, result.next_arg_id>(
spec_field<char_type, typename field_type<T>::type, ARG_INDEX>{
result.fmt},
format_str);
fmt);
}
}
}
......@@ -341,22 +352,21 @@ constexpr auto parse_replacement_field_then_tail(S format_str) {
// Compiles a non-empty format string and returns the compiled representation
// or unknown_format() on unrecognized input.
template <typename Args, size_t POS, int ID, typename S>
constexpr auto compile_format_string(S format_str) {
constexpr auto compile_format_string(S fmt) {
using char_type = typename S::char_type;
constexpr auto str = basic_string_view<char_type>(format_str);
constexpr auto str = basic_string_view<char_type>(fmt);
if constexpr (str[POS] == '{') {
if constexpr (POS + 1 == str.size())
FMT_THROW(format_error("unmatched '{' in format string"));
if constexpr (str[POS + 1] == '{') {
return parse_tail<Args, POS + 2, ID>(make_text(str, POS, 1), format_str);
return parse_tail<Args, POS + 2, ID>(make_text(str, POS, 1), fmt);
} else if constexpr (str[POS + 1] == '}' || str[POS + 1] == ':') {
static_assert(ID != manual_indexing_id,
"cannot switch from manual to automatic argument indexing");
constexpr auto next_id =
ID != manual_indexing_id ? ID + 1 : manual_indexing_id;
return parse_replacement_field_then_tail<get_type<ID, Args>, Args,
POS + 1, ID, next_id>(
format_str);
POS + 1, ID, next_id>(fmt);
} else {
constexpr auto arg_id_result =
parse_arg_id<ID>(str.data() + POS + 1, str.data() + str.size());
......@@ -364,28 +374,27 @@ constexpr auto compile_format_string(S format_str) {
constexpr char_type c =
arg_id_end_pos != str.size() ? str[arg_id_end_pos] : char_type();
static_assert(c == '}' || c == ':', "missing '}' in format string");
if constexpr (arg_id_result.arg_id.kind == arg_id_kind::index) {
if constexpr (arg_id_result.kind == arg_id_kind::index) {
static_assert(
ID == manual_indexing_id || ID == 0,
"cannot switch from automatic to manual argument indexing");
constexpr auto arg_index = arg_id_result.arg_id.val.index;
constexpr auto arg_index = arg_id_result.arg_id.index;
return parse_replacement_field_then_tail<get_type<arg_index, Args>,
Args, arg_id_end_pos,
arg_index, manual_indexing_id>(
format_str);
} else if constexpr (arg_id_result.arg_id.kind == arg_id_kind::name) {
fmt);
} else if constexpr (arg_id_result.kind == arg_id_kind::name) {
constexpr auto arg_index =
get_arg_index_by_name(arg_id_result.arg_id.val.name, Args{});
get_arg_index_by_name(arg_id_result.arg_id.name, Args{});
if constexpr (arg_index >= 0) {
constexpr auto next_id =
ID != manual_indexing_id ? ID + 1 : manual_indexing_id;
return parse_replacement_field_then_tail<
decltype(get_type<arg_index, Args>::value), Args, arg_id_end_pos,
arg_index, next_id>(format_str);
arg_index, next_id>(fmt);
} else if constexpr (c == '}') {
return parse_tail<Args, arg_id_end_pos + 1, ID>(
runtime_named_field<char_type>{arg_id_result.arg_id.val.name},
format_str);
runtime_named_field<char_type>{arg_id_result.arg_id.name}, fmt);
} else if constexpr (c == ':') {
return unknown_format(); // no type info for specs parsing
}
......@@ -394,29 +403,26 @@ constexpr auto compile_format_string(S format_str) {
} else if constexpr (str[POS] == '}') {
if constexpr (POS + 1 == str.size())
FMT_THROW(format_error("unmatched '}' in format string"));
return parse_tail<Args, POS + 2, ID>(make_text(str, POS, 1), format_str);
return parse_tail<Args, POS + 2, ID>(make_text(str, POS, 1), fmt);
} else {
constexpr auto end = parse_text(str, POS + 1);
if constexpr (end - POS > 1) {
return parse_tail<Args, end, ID>(make_text(str, POS, end - POS),
format_str);
return parse_tail<Args, end, ID>(make_text(str, POS, end - POS), fmt);
} else {
return parse_tail<Args, end, ID>(code_unit<char_type>{str[POS]},
format_str);
return parse_tail<Args, end, ID>(code_unit<char_type>{str[POS]}, fmt);
}
}
}
template <typename... Args, typename S,
FMT_ENABLE_IF(detail::is_compiled_string<S>::value)>
constexpr auto compile(S format_str) {
constexpr auto str = basic_string_view<typename S::char_type>(format_str);
FMT_ENABLE_IF(is_compiled_string<S>::value)>
constexpr auto compile(S fmt) {
constexpr auto str = basic_string_view<typename S::char_type>(fmt);
if constexpr (str.size() == 0) {
return detail::make_text(str, 0, 0);
} else {
constexpr auto result =
detail::compile_format_string<detail::type_list<Args...>, 0, 0>(
format_str);
detail::compile_format_string<detail::type_list<Args...>, 0, 0>(fmt);
return result;
}
}
......@@ -445,7 +451,7 @@ constexpr FMT_INLINE OutputIt format_to(OutputIt out, const CompiledFormat& cf,
}
template <typename S, typename... Args,
FMT_ENABLE_IF(detail::is_compiled_string<S>::value)>
FMT_ENABLE_IF(is_compiled_string<S>::value)>
FMT_INLINE std::basic_string<typename S::char_type> format(const S&,
Args&&... args) {
if constexpr (std::is_same<typename S::char_type, char>::value) {
......@@ -472,7 +478,7 @@ FMT_INLINE std::basic_string<typename S::char_type> format(const S&,
}
template <typename OutputIt, typename S, typename... Args,
FMT_ENABLE_IF(detail::is_compiled_string<S>::value)>
FMT_ENABLE_IF(is_compiled_string<S>::value)>
FMT_CONSTEXPR OutputIt format_to(OutputIt out, const S&, Args&&... args) {
constexpr auto compiled = detail::compile<Args...>(S());
if constexpr (std::is_same<remove_cvref_t<decltype(compiled)>,
......@@ -487,43 +493,42 @@ FMT_CONSTEXPR OutputIt format_to(OutputIt out, const S&, Args&&... args) {
#endif
template <typename OutputIt, typename S, typename... Args,
FMT_ENABLE_IF(detail::is_compiled_string<S>::value)>
format_to_n_result<OutputIt> format_to_n(OutputIt out, size_t n,
const S& format_str, Args&&... args) {
FMT_ENABLE_IF(is_compiled_string<S>::value)>
auto format_to_n(OutputIt out, size_t n, const S& fmt, Args&&... args)
-> format_to_n_result<OutputIt> {
using traits = detail::fixed_buffer_traits;
auto buf = detail::iterator_buffer<OutputIt, char, traits>(out, n);
format_to(std::back_inserter(buf), format_str, std::forward<Args>(args)...);
fmt::format_to(std::back_inserter(buf), fmt, std::forward<Args>(args)...);
return {buf.out(), buf.count()};
}
template <typename S, typename... Args,
FMT_ENABLE_IF(detail::is_compiled_string<S>::value)>
FMT_CONSTEXPR20 size_t formatted_size(const S& format_str,
const Args&... args) {
return fmt::format_to(detail::counting_iterator(), format_str, args...)
.count();
FMT_ENABLE_IF(is_compiled_string<S>::value)>
FMT_CONSTEXPR20 auto formatted_size(const S& fmt, const Args&... args)
-> size_t {
auto buf = detail::counting_buffer<>();
fmt::format_to(appender(buf), fmt, args...);
return buf.count();
}
template <typename S, typename... Args,
FMT_ENABLE_IF(detail::is_compiled_string<S>::value)>
void print(std::FILE* f, const S& format_str, const Args&... args) {
memory_buffer buffer;
fmt::format_to(std::back_inserter(buffer), format_str, args...);
detail::print(f, {buffer.data(), buffer.size()});
FMT_ENABLE_IF(is_compiled_string<S>::value)>
void print(std::FILE* f, const S& fmt, const Args&... args) {
auto buf = memory_buffer();
fmt::format_to(appender(buf), fmt, args...);
detail::print(f, {buf.data(), buf.size()});
}
template <typename S, typename... Args,
FMT_ENABLE_IF(detail::is_compiled_string<S>::value)>
void print(const S& format_str, const Args&... args) {
print(stdout, format_str, args...);
FMT_ENABLE_IF(is_compiled_string<S>::value)>
void print(const S& fmt, const Args&... args) {
print(stdout, fmt, args...);
}
#if FMT_USE_NONTYPE_TEMPLATE_ARGS
inline namespace literals {
template <detail_exported::fixed_string Str> constexpr auto operator""_cf() {
using char_t = remove_cvref_t<decltype(Str.data[0])>;
return detail::udl_compiled_string<char_t, sizeof(Str.data) / sizeof(char_t),
Str>();
template <detail::fixed_string Str> constexpr auto operator""_cf() {
return FMT_COMPILE(Str.data);
}
} // namespace literals
#endif
......
This diff is collapsed.