My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
CodeStyle  
Code Style for our implementation.
Phase-Implementation
Updated Jan 15, 2009 by mx.cog...@gmail.com

Introduction

Code Style和给出的API中的style一致,大部分参考Google C++ Style Guide 下面列出了一些必要的,漏掉了的大家再补充

Details

Naming

Sample Naming Style:
ErrCode closeIndex(IdxState *idxState);
  • Type names
Start with a capital letter and have a capital letter for each new word, with no underscores:ErrCode, IdxState.
  • Variable Name
Variable names are all lowercase, with underscores between words. Class member variables have trailing underscores. For instance: my_exciting_local_variable, my_exciting_member_variable. For global variables, prefix it with g or some other marker to easily distinguish it from local variables.
  • Constant Names
Use a k followed by mixed case: kDaysInAWeek.
  • Function name
按照closeIndex这种命名方式,首字母小写,其他单词大写.T-Tree的外部接口以tt打头, e.g. ttSearch()

Comment

http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Comments

Indent

tab = 4 blank

#vim的设置
set tabstop = 4
set shiftwidth = 4
Comment by project member lgy...@gmail.com, Jan 15, 2009

关于大括号的战争呢?。。。

Powered by Google Project Hosting