473,671 Members | 2,384 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please help: How to reformat existing c++ files using emacs or VC6.0

If there is any command for formatting all files under a directory, that
would be best.
But currently, formatting a single file is enough for me. I just can not
type TAB at each line.
Thanks a lot!

--
Xiaopeng Xiong
CS143, Computer Sciences Building
Purdue University, West Lafayette, IN, 47907
Tel: (765)496-6038
URL: http://www.cs.purdue.edu/homes/xxiong
Jul 23 '05 #1
3 1562
Xiaopeng Xiong wrote:
If there is any command for formatting all files under a directory, that
would be best.
But currently, formatting a single file is enough for me. I just can not
type TAB at each line.


Is there a C++ _language_ question I'm not seeing? Are you asking how to
open files and replace their contents with other contents? std::fstream
class is used for file reading/writing. Replacement is rarely done in
place, you're better off creating a new file for every one you need to
edit, and then renaming the old file with .bak or something and the new
file to have the name of the old file. 'std::ifstream' is for reading
and 'std::ofstream' is for writing.

Or maybe you're asking about a tool that can change your source files for
you? Look up "C++ beautifier" on the Web. If you need to know how to do
the formatting in your text editor, why don't you just RTFM?
Jul 23 '05 #2
Xiaopeng Xiong wrote:
If there is any command for formatting all files under a directory, that
would be best.
But currently, formatting a single file is enough for me. I just can not
type TAB at each line.
Thanks a lot!


i would venture to say your post is OT. post to emacs or VC NG. but, i'll
answer anyhow. for emacs. i haven't used anything but in a long time so i
wouldn't know how to do it in VC.

i don't know about doing a whole directory at a time - although it's
certainly possible with emacs. for a single file, open the file, make sure
you're in c/cpp mode. type:

C-x-h
C-M-\

cheers,
anoop aryal.

Jul 23 '05 #3
Okay I see the question is out of the scope here. Let's finish this topic
now. Sorry.
Thanks Victor and Anoop for the detailed help. I did get some ideas out of
the replies.
"Anoop Aryal" <aa****@foresig htint.com> wrote in message
news:KL******** *********@newss vr17.news.prodi gy.com...
Xiaopeng Xiong wrote:
If there is any command for formatting all files under a directory, that
would be best.
But currently, formatting a single file is enough for me. I just can not
type TAB at each line.
Thanks a lot!

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
2912
by: Brett Baisley | last post by:
At school, we do all of our coding in emacs, but I am trying to get the example apps working at home using Visual C++.net. In the example, there are 4 .cpp files (canvas.cpp, main.cpp, myDisplay.cpp and tween.cpp) a header file (canvas.h) and a makefile that compiles it for linux. The tween.cpp is the main file, and it only contains inludes statements to the other files.
1
9623
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej and I was wondering if anyone here would be able to give me some tips for young players such as myself, for learning the language. Is this the best Newsgroup for support with JAVA?
118
6696
by: 63q2o4i02 | last post by:
Hi, I've been thinking about Python vs. Lisp. I've been learning Python the past few months and like it very much. A few years ago I had an AI class where we had to use Lisp, and I absolutely hated it, having learned C++ a few years prior. They didn't teach Lisp at all and instead expected us to learn on our own. I wasn't aware I had to uproot my thought process to "get" it and wound up feeling like a moron. In learning Python I've...
0
3076
by: Xah Lee | last post by:
Interactive Find and Replace String Patterns on Multiple Files Xah Lee, 2006-06 Suppose you need to do find and replace of a string pattern, for all files in a directory. However, you do not want to replace all of them. You need to look at it in a case-by-case basis. What can you do? Answer: emacs.
7
1775
by: rn5a | last post by:
This is the second time I am asking this question in this newsgroup since I haven't got a solution or response from anyone in my previous post & I need to resolve this issue desperately. Sorry for the double post but I just didn't have any other option other than re-posting the same question in this newsgroup. Consider the following code in a VB class file: Namespace LoginUserFetchDB Public Class ZForZebra : Inherits SoapHeader
5
14426
by: Glen Buell | last post by:
Hi all, I have a major problem with my ASP.NET website and it's SQL Server 2005 Express database, and I'm wondering if anyone could help me out with it. This site is on a webhost (WebHost4Life) and was running fine and dandy, until I decided I needed to add some additional stored procedures to the database.
11
1471
by: Roy | last post by:
Hi , could you please list the reasons why we different C files for writing code . We use header files to logically group functionality that is related . Is there any other reason why we need to use different C files ?
1
1215
by: sparks | last post by:
We are redoing an existing database and need to reformat all the number fields from integer to single fixed 3. their main thing is negative numbers and the decimal places. Can this be done in code? field size long -->single format fixed decimal places 3
4
195
by: Mark McIntyre | last post by:
Hallvard B Furuseth wrote: Setting aside that 4 is an entirely sensible tab width... This seems to be the showstopper. Unless you now entirely own the code yourself alone, don't reformat it it, will merely annoy the collaboration team.
0
8481
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8823
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8602
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8672
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6234
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4412
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.